| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
So is there any procedure for News entries for bugfixes that need to be backported to older versions of CPython? |
Sorry, something went wrong.
|
I would suggest the following fixup to make this work on BE (mtime is always LE, regardless of the host endianness): --- a/Lib/test/test_gzip.py
+++ b/Lib/test/test_gzip.py
@@ -725,7 +725,7 @@ def test_issue112346(self):
for mtime in (0, 42):
with self.subTest(mtime=mtime):
compress = gzip.compress(data1, compresslevel=1, mtime=mtime)
- assert struct.unpack("IxB", compress[4:10]) == (mtime, 255)
+ assert struct.unpack("<IxB", compress[4:10]) == (mtime, 255)
def test_decompress(self):
for data in (data1, data2):
|
Sorry, something went wrong.
|
Thanks for the suggestion @iii-i . That was an oversight on my part. I am going to pin in the hope this fix gets noticed. |
Sorry, something went wrong.
|
ping |
Sorry, something went wrong.
|
Ping @gpshead . Could you shine your light on this? It's only a very small change and it has remained under the radar for almost half a year now. |
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM, except using assert in the test.
Sorry, something went wrong.
| for mtime in (0, 42): | ||
| with self.subTest(mtime=mtime): | ||
| compress = gzip.compress(data1, compresslevel=1, mtime=mtime) | ||
| assert struct.unpack("<IxB", compress[4:10]) == (mtime, 255) |
There was a problem hiding this comment.
Use TestCase assertion methods instead of the assert statement.
Sorry, something went wrong.
There was a problem hiding this comment.
Done!
Sorry, something went wrong.
|
Thanks for reviewing this so quickly @serhiy-storchaka . I added a news entry. |
Sorry, something went wrong.
|
I suggest not making this change given how long it has been the behavior of released Pythons. We cannot backport this to 3.11 as it is not a security issue. And anyone picking a change like this up in a patch release is just as likely to run into problems with the behavior change between differing Python versions. |
Sorry, something went wrong.
|
@gpshead That makes sense. Sorry, I went into panic mode when code changes I made gave someone some reproducibility troubles. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
As mentioned in the linked issue, delegating to zlib.compress causes behavorial changes in the OS byte. As a result this change caused reproducible build failures. The separate codepath caused issues before as well:
#90425
Therefore the codepath should be removed. Speed ain't everything. The mention of zlib.compress in the documentation is maintained so users who not have specific requirements can use the speedier path.
This change needs to be backported to 3.11 and 3.12
📚 Documentation preview 📚: https://cpython-previews--114116.org.readthedocs.build/