Skip to content
Closed
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/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ def FileHeader(self, zip64=None):

def _encodeFilenameFlags(self):
try:
return self.filename.encode('ascii'), self.flag_bits
return self.filename.encode('cp437'), self.flag_bits
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would need to add the removal of the UTF-8 bit from flag_bits again... which would re-create this regression. #95463

I'll follow up on the issue.

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 @@
:mod:`zipfile` now knows that old zip files were saved in cp437 (OEM-US),
not in ASCII.