This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ivan.sorokin.tech
Recipients ivan.sorokin.tech
Date 2020-10-04.11:36:22
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1601811382.76.0.398158982461.issue41929@roundup.psfhosted.org>
In-reply-to
Content
ZipFile has problems with filename charset in .zip archives having filenames charset encoded in OEM code page.

ZipFile assumes that OEM code page always means "cp437". Actually many popular .zip packers (for example, Windows internal "zip folders" tool) use OEM code page corresponding to system locale to write file names in .zip files.

To read such files correctly we should detect correct OEM code page from system locale instead of sticking to cp437.

Here is locale-to-oem-code-page conversion table, generated from Wine source code:
https://github.com/unxed/oemcp/blob/master/oemcp.txt

Sample archive is attached. The file inside should be extracted as "Новый текстовый документ.txt" when ru_RU system locale is set.
History
Date User Action Args
2020-10-04 11:36:22ivan.sorokin.techsetrecipients: + ivan.sorokin.tech
2020-10-04 11:36:22ivan.sorokin.techsetmessageid: <1601811382.76.0.398158982461.issue41929@roundup.psfhosted.org>
2020-10-04 11:36:22ivan.sorokin.techlinkissue41929 messages
2020-10-04 11:36:22ivan.sorokin.techcreate