Message 336183 - Python tracker

Message336183

Author serhiy.storchaka
Recipients Shane Lee, paul.moore, serhiy.storchaka, steve.dower, tim.golden, zach.ware
Date 2019-02-21.05:40:42
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1550727642.36.0.0217432052701.issue36061@roundup.psfhosted.org>
In-reply-to
Content
You can not just add .decode('cp437') to arcname.

1. This will fail if the ZIP archive contains file names encoded with UTF-8. They are already unicode and contains non-ascii characters. For decode() they will be implicit encoded to str, that will fail.

2. This will fail when targetpath is a 8-bit string containing non-ascii characters. Currently this works (maybe incorrectly).

3. While cp437 is the only official encoding in ZIP archives if UTF-8 is not used, de facto different encodings (like cp866) are used on localized Windows.

Fixing the problem without introducing other problems and breaking existing working code is hard. One possible solution is using Python 3.

I suggest to close this issue as "won't fix".
History
Date User Action Args
2019-02-21 05:40:42serhiy.storchakasetrecipients: + serhiy.storchaka, paul.moore, tim.golden, zach.ware, steve.dower, Shane Lee
2019-02-21 05:40:42serhiy.storchakasetmessageid: <1550727642.36.0.0217432052701.issue36061@roundup.psfhosted.org>
2019-02-21 05:40:42serhiy.storchakalinkissue36061 messages
2019-02-21 05:40:42serhiy.storchakacreate