[issue28007] Bad .pyc files prevent import of otherwise valid .py files.

2021-02-19 Thread Brett Cannon
Brett Cannon added the comment: Since this is still open I would assume it never made it in. -- ___ Python tracker ___ ___

[issue28007] Bad .pyc files prevent import of otherwise valid .py files.

2021-02-19 Thread Brian Hulette
Brian Hulette added the comment: Hey there, I just came across this bug when looking into a problem with corrupted pyc files. Was the patch ever applied? I'm still seeing the original behavior in Python 3.7. Thanks! -- nosy: +hulettbh ___ Python

[issue28007] Bad .pyc files prevent import of otherwise valid .py files.

2016-09-12 Thread Eric Snow
Eric Snow added the comment: I was going to ask Ned, but I'm fine with holding off until 3.7. :) -- ___ Python tracker ___

[issue28007] Bad .pyc files prevent import of otherwise valid .py files.

2016-09-12 Thread Brett Cannon
Brett Cannon added the comment: I don't think we should try and squeeze this in for 3.6 since we have now hit beta and this is a feature since this is changing semantics that date back to Python 2. I'm going to go ahead and change the target to 3.7. -- versions: +Python 3.7 -Python

[issue28007] Bad .pyc files prevent import of otherwise valid .py files.

2016-09-12 Thread Eric Snow
Changes by Eric Snow : Removed file: http://bugs.python.org/file44601/issue28007.diff ___ Python tracker ___

[issue28007] Bad .pyc files prevent import of otherwise valid .py files.

2016-09-12 Thread Eric Snow
Changes by Eric Snow : Added file: http://bugs.python.org/file44604/issue28007.diff ___ Python tracker ___

[issue28007] Bad .pyc files prevent import of otherwise valid .py files.

2016-09-12 Thread Eric Snow
Eric Snow added the comment: Here's a patch to soften the impact of pyc-related problems. Note: * Each pyc-related case that previously caused import to fail now results in an ImportWarning. This applies to both reading and writing .pyc files. * Each warning has __cause__ set to the caught

[issue28007] Bad .pyc files prevent import of otherwise valid .py files.

2016-09-09 Thread Eric Snow
Changes by Eric Snow : -- assignee: -> eric.snow ___ Python tracker ___ ___

[issue28007] Bad .pyc files prevent import of otherwise valid .py files.

2016-09-09 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: On Sep 09, 2016, at 08:30 PM, Terry J. Reedy wrote: >I think we should definitely fall back to using the .py file. A cache is an >implementation convenience, not a language feature. +1. If the cache is corrupt, it should be ignored and recreated. There are

[issue28007] Bad .pyc files prevent import of otherwise valid .py files.

2016-09-09 Thread Terry J. Reedy
Terry J. Reedy added the comment: I think we should definitely fall back to using the .py file. A cache is an implementation convenience, not a language feature. A student using an all-users install typically does not have admin access to delete bad .pyc files. In Windows, a user install is

[issue28007] Bad .pyc files prevent import of otherwise valid .py files.

2016-09-07 Thread R. David Murray
R. David Murray added the comment: That makes sense to me as a use case for warnings only. -- ___ Python tracker ___

[issue28007] Bad .pyc files prevent import of otherwise valid .py files.

2016-09-07 Thread Nick Coghlan
Nick Coghlan added the comment: I run into this kind of problem when switching back and forth between running things directly on my laptop and running them as a mounted volume in a container, since the permissions and SELinux labels on the cache can get messed up. However, in those cases,

[issue28007] Bad .pyc files prevent import of otherwise valid .py files.

2016-09-07 Thread Sye van der Veen
Sye van der Veen added the comment: Consider a process that is terminated while writing a large .pyc file. Currently a user can only fix this by deleting the .pyc file, which requires knowing where to look. A developer can be expected to know this, but the end user of their application

[issue28007] Bad .pyc files prevent import of otherwise valid .py files.

2016-09-07 Thread R. David Murray
R. David Murray added the comment: I agree, I don't think it is worth it. If we did do it, there should be a warning, and things should still fail if the new .pyc file can't be written to replace the corrupt one. -- nosy: +r.david.murray ___

[issue28007] Bad .pyc files prevent import of otherwise valid .py files.

2016-09-07 Thread Eric Snow
New submission from Eric Snow: As pointed out in #16384, a bad .pyc file will cause a module to fail importing. Sometimes the .py file is okay, however. The question posed in the other issue is if it would be desirable to fall back to the .py file. FWIW, I don't think it's worth it.