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
of course situations where that may not be possible though, e.g. if the .pyc
is on a read-only file system or the user doesn't have permission to write the
.pyc.  Still in those cases, if the .py is okay, but the .pyc is not, we
should do a source import.  I believe we already don't fall over if the .pyc
isn't writable, so let's keep that.  Although I don't think it's worth it, we
could add some extra knobs to warn about this case, or to be strict about not
allowing source imports.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue28007>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to