This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Add an option to disable importing orphaned bytecode files
Type: enhancement Stage: resolved
Components: Interpreter Core Versions: Python 3.3
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: brett.cannon, ncoghlan, petri.lehtinen, pitrou
Priority: normal Keywords:

Created on 2011-10-26 07:23 by petri.lehtinen, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (2)
msg146423 - (view) Author: Petri Lehtinen (petri.lehtinen) * (Python committer) Date: 2011-10-26 07:23
This has been discussed in python-ideas approx. two years ago:

http://mail.python.org/pipermail/python-ideas/2009-December/006635.html

It seems to me that having an opt-in command-line option, environment variable and sys variable to disable loading orphaned bytecode files upon import had most use cases and gained most support.
msg146425 - (view) Author: Nick Coghlan (ncoghlan) * (Python committer) Date: 2011-10-26 08:18
This feature is unnecessary now that PEP 3147 has been adopted. The way it works in 3.2+ is that orphaned bytecode files inside __pycache__ are always ignored, while bytecode files that live directly in the source directories are always imported.

This handles both use cases nicely:
- the implicitly created cache files are ignored if their source file has been deleted
- bytecode only distribution is still supported by explicitly installing bytecode files instead of source files
History
Date User Action Args
2022-04-11 14:57:23adminsetgithub: 57476
2011-10-26 08:18:27ncoghlansetstatus: open -> closed
resolution: out of date
messages: + msg146425

stage: resolved
2011-10-26 07:23:05petri.lehtinencreate