New submission from Nick Coghlan:

The magic number change in 3.5.3 broke the world when Fedora attempted to 
rebase from 3.5.2, but upstream CPython developers don't currently get an 
automated notification that it isn't permitted to change the magic number in a 
maintenance release - instead, the current approach relies on people "just 
knowing" not to do that, and we just saw the limitations of relying on the code 
review process to catch this particular problem.


I think we can keep this from happening again by having an importlib test case 
that fails if sys.version_info.releaselevel is "candidate" or "final" and 
either:

- no "expected magic number" is defined; or
- the actual magic number in importlib.util.MAGIC_NUMBER doesn't match the 
expected one

The comments on the new test case would then explain the policy and why it 
isn't OK to break pyc file compatibility in a maintenance release.

We'd also propose an update to the release PEP warning release managers to 
expect this error as part of prepping the first release candidate, and that 
they should lock in the magic number for the release at that time.

----------
messages: 287428
nosy: barry, brett.cannon, doko, encukou, ncoghlan
priority: normal
severity: normal
status: open
title: Add a test case that prevents magic number changes in minor releases
versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7

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

Reply via email to