[Python-checkins] gh-95463: Remove backwards incompatible change regarding the _MASK_UTF_FILENAME flags in bpo-28080 (GH-96072)
miss-islington
webhook-mailer at python.org
Thu Aug 18 19:46:21 EDT 2022
https://github.com/python/cpython/commit/9d066e2aa621125cd141b14df79955d74b7f258e
commit: 9d066e2aa621125cd141b14df79955d74b7f258e
branch: main
author: Pablo Galindo Salgado <Pablogsal at gmail.com>
committer: miss-islington <31488909+miss-islington at users.noreply.github.com>
date: 2022-08-18T16:45:55-07:00
summary:
gh-95463: Remove backwards incompatible change regarding the _MASK_UTF_FILENAME flags in bpo-28080 (GH-96072)
Automerge-Triggered-By: GH:pablogsal
files:
A Misc/NEWS.d/next/Library/2022-08-18-14-53-53.gh-issue-95463.GpP05c.rst
M Lib/zipfile.py
diff --git a/Lib/zipfile.py b/Lib/zipfile.py
index 981560082ca..903d09dc023 100644
--- a/Lib/zipfile.py
+++ b/Lib/zipfile.py
@@ -480,7 +480,7 @@ def FileHeader(self, zip64=None):
def _encodeFilenameFlags(self):
try:
- return self.filename.encode('ascii'), self.flag_bits & ~_MASK_UTF_FILENAME
+ return self.filename.encode('ascii'), self.flag_bits
except UnicodeEncodeError:
return self.filename.encode('utf-8'), self.flag_bits | _MASK_UTF_FILENAME
diff --git a/Misc/NEWS.d/next/Library/2022-08-18-14-53-53.gh-issue-95463.GpP05c.rst b/Misc/NEWS.d/next/Library/2022-08-18-14-53-53.gh-issue-95463.GpP05c.rst
new file mode 100644
index 00000000000..553c55436aa
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2022-08-18-14-53-53.gh-issue-95463.GpP05c.rst
@@ -0,0 +1,2 @@
+Remove an incompatible change from :issue:`28080` that caused a regression
+that ignored the utf8 in ``ZipInfo.flag_bits``. Patch by Pablo Galindo.
More information about the Python-checkins
mailing list