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.

Title: implement PEP 552
Type: enhancement Stage: resolved
Components: Interpreter Core Versions: Python 3.7
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: benjamin.peterson Nosy List: barry, benjamin.peterson, serhiy.storchaka, vstinner
Priority: normal Keywords: patch

Created on 2017-09-30 19:59 by benjamin.peterson, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 4575 merged benjamin.peterson, 2017-11-26 22:39
PR 8608 merged vstinner, 2018-08-01 16:04
Messages (8)
msg303423 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2017-09-30 19:59
Now that PEP 552 is accepted, we'll need an actual implementation. Besides the core import changes, there are some perquisites improvements. For one, our SipHash implementation needs to be changed to accept an arbitrary key. Also, the PEP also introduces the first "long" option to the interpreter, so the getopt implementation will have to be enhanced.
msg307884 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-12-09 09:06
While we are here, can other changes be made?

1. Increase the size of the constant part of the signature. Currently it is only 2 bytes (3rd and 4th bytes are b'\r\n') and it is hard to use them in tools like `file`.

2. Split the magic number on two parts. The first part encodes backward-incompatible changes and can be updated only in new feature releases. The second part encodes backward compatible changes and can be changed in bugfix releases.

3. Maybe even include the minimal Python version? This would simplify the launcher which needs to map a magic number to Python version.
msg307908 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2017-12-09 18:24
On Sat, Dec 9, 2017, at 01:06, Serhiy Storchaka wrote:
> Serhiy Storchaka <> added the comment:
> While we are here, can other changes be made?

All these suggestions seem fine, but they're not in the PEP and the
change is already large enough.

gps also points out we should expand the timestamp field to 64 bits for
2038 proofing.
msg307909 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2017-12-09 18:26
New changeset 42aa93b8ff2f7879282b06efc73a31ec7785e602 by Benjamin Peterson in branch 'master':
closes bpo-31650: PEP 552 (Deterministic pycs) implementation (#4575)
msg308047 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-12-11 14:52
Failure on Python on s390x RHEL 3.x:

FAIL: test_source_hash (test.test_imp.ImportTests)
Traceback (most recent call last):
  File "/home/dje/cpython-buildarea/3.x.edelsohn-rhel-z/build/Lib/test/", line 335, in test_source_hash
    self.assertEqual(_imp.source_hash(42, b'hi'), b'\xc6\xe7Z\r\x03:}\xab')
AssertionError: b'Yb\x91||\x91bY' != b'\xc6\xe7Z\r\x03:}\xab'
msg308061 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2017-12-11 16:57
Looks fine to me now?
msg308096 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-12-12 08:55
The test failed on s390x RHEL 3.x, PPC64 Fedora 3.x, s390x SLES 3.x, s390x Debian 3.x, s390x RHEL 3.x They are now all green, good!
msg322869 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-08-01 16:18
New changeset 80b762f010097ab8137782e5fbdc89c5c620ed4e by Victor Stinner in branch 'master':
bpo-31650: Remove _Py_CheckHashBasedPycsMode global config var (GH-8608)
Date User Action Args
2022-04-11 14:58:53adminsetgithub: 75831
2018-08-01 16:18:10vstinnersetmessages: + msg322869
2018-08-01 16:04:12vstinnersetpull_requests: + pull_request8113
2017-12-12 08:55:37vstinnersetmessages: + msg308096
2017-12-12 07:17:05benjamin.petersonsetstatus: open -> closed
resolution: fixed
2017-12-11 16:57:52benjamin.petersonsetmessages: + msg308061
2017-12-11 14:52:44vstinnersetstatus: closed -> open

nosy: + vstinner
messages: + msg308047

resolution: fixed -> (no value)
2017-12-09 18:26:54benjamin.petersonsetstatus: open -> closed
resolution: fixed
messages: + msg307909

stage: patch review -> resolved
2017-12-09 18:24:32benjamin.petersonsetmessages: + msg307908
2017-12-09 09:06:59serhiy.storchakasetnosy: + serhiy.storchaka
messages: + msg307884
2017-11-26 22:39:18benjamin.petersonsetkeywords: + patch
stage: needs patch -> patch review
pull_requests: + pull_request4503
2017-10-01 00:28:47barrysetnosy: + barry
2017-09-30 19:59:56benjamin.petersoncreate