From 6ffe7bcd47eaaefa29ca837bb389845d45244533 Mon Sep 17 00:00:00 2001 From: Pablo Galindo Date: Thu, 18 Aug 2022 14:50:59 +0100 Subject: [PATCH] gh-95463: Remove backwards incompatible change regarding the _MASK_UTF_FILENAME flags in bpo-28080 Signed-off-by: Pablo Galindo --- Lib/zipfile.py | 2 +- .../next/Library/2022-08-18-14-53-53.gh-issue-95463.GpP05c.rst | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 Misc/NEWS.d/next/Library/2022-08-18-14-53-53.gh-issue-95463.GpP05c.rst diff --git a/Lib/zipfile.py b/Lib/zipfile.py index 981560082cab7a..903d09dc023e69 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 00000000000000..553c55436aab08 --- /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.