Message287585
This is strictly a problem for the system Python, right? In that case, can't the dist package clear __pycache__ under the system site-packages directory (and any other user-read-only dirs) during install of the updated Python?
Is the concern that upgrading Python may force all .pyc files to be re-written (perhaps unnecessarily)? If so, I'm not clear on why it's okay between major versions but not minor ones. Frequency perhaps? Is the cost of re-compiling all .pyc files (which mostly won't happen all at the same time) significant enough to warrant changing the status quo, particularly since the magic number rarely changes in a minor release?
As one (poor) alternative, we could require re-compiling a .pyc file only if it contains the affected bytecode(s). Granted, that would probably require associating every bytecode with a magic number. The required comparison would likely be more expensive than just re-compiling. :/
Another alternative would be to leverage sys.dont_write_bytecode somehow. |
|
Date |
User |
Action |
Args |
2017-02-11 01:37:11 | eric.snow | set | recipients:
+ eric.snow, barry, brett.cannon, doko, ncoghlan, petr.viktorin |
2017-02-11 01:37:11 | eric.snow | set | messageid: <1486777031.09.0.952857867061.issue29514@psf.upfronthosting.co.za> |
2017-02-11 01:37:11 | eric.snow | link | issue29514 messages |
2017-02-11 01:37:09 | eric.snow | create | |
|