Skip to content

gh-95463: Remove backwards incompatible change regarding the _MASK_UTF_FILENAME flags in bpo-28080 #96072

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Lib/zipfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -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.