Re: [Python-Dev] non-US zip archives support in zipfile.py

2013-10-17 Thread Toshio Kuratomi
On Tue, Oct 15, 2013 at 03:46:15PM +0200, "Martin v. Löwis" wrote: > Am 15.10.13 14:49, schrieb Daniel Holth: > > It is part of the ZIP specification. CP437 or UTF-8 are the two > > official choices, but other encodings happen on Russian, Japanese > > systems. > > Indeed. Formally, the other encod

Re: [Python-Dev] non-US zip archives support in zipfile.py

2013-10-15 Thread Martin v. Löwis
Am 15.10.13 14:49, schrieb Daniel Holth: > It is part of the ZIP specification. CP437 or UTF-8 are the two > official choices, but other encodings happen on Russian, Japanese > systems. Indeed. Formally, the other encodings are not supported by the ZIP specification, and are thus formally misuse o

Re: [Python-Dev] non-US zip archives support in zipfile.py

2013-10-15 Thread Oleg Broytman
Hi! On Tue, Oct 15, 2013 at 12:22:29PM +0200, "\"Martin v. L?wis\"" wrote: > Am 15.10.13 10:53, schrieb Daniel Holth: > > FYI zipfile does do UTF-8 > > (http://hg.python.org/cpython/file/d7ebe03fa752/Lib/zipfile.py#l368). > > Only the non-Unicode encodings might need some help. I like that the >

Re: [Python-Dev] non-US zip archives support in zipfile.py

2013-10-15 Thread Daniel Holth
On Tue, Oct 15, 2013 at 8:02 AM, Steven D'Aprano wrote: > On Tue, Oct 15, 2013 at 10:20:03AM +0200, Victor Stinner wrote: >> Both issues are related and should be fixed in the *same* commit. >> Python should provide an option to encode explicitly filenames to >> UTF-8. Or maybe better: encode to U

Re: [Python-Dev] non-US zip archives support in zipfile.py

2013-10-15 Thread Steven D'Aprano
On Tue, Oct 15, 2013 at 10:20:03AM +0200, Victor Stinner wrote: > Both issues are related and should be fixed in the *same* commit. > Python should provide an option to encode explicitly filenames to > UTF-8. Or maybe better: encode to UTF-8 by default, with an option to > encode to cp437, and anot

Re: [Python-Dev] non-US zip archives support in zipfile.py

2013-10-15 Thread Martin v. Löwis
Am 15.10.13 10:53, schrieb Daniel Holth: > FYI zipfile does do UTF-8 > (http://hg.python.org/cpython/file/d7ebe03fa752/Lib/zipfile.py#l368). > Only the non-Unicode encodings might need some help. I like that the > patch is only concerned with decoding. Is it necessary to support > writing non-UTF8

Re: [Python-Dev] non-US zip archives support in zipfile.py

2013-10-15 Thread Daniel Holth
FYI zipfile does do UTF-8 (http://hg.python.org/cpython/file/d7ebe03fa752/Lib/zipfile.py#l368). Only the non-Unicode encodings might need some help. I like that the patch is only concerned with decoding. Is it necessary to support writing non-UTF8 encodings? On Tue, Oct 15, 2013 at 10:20 AM, Victo

Re: [Python-Dev] non-US zip archives support in zipfile.py

2013-10-15 Thread Victor Stinner
Both issues are related and should be fixed in the *same* commit. Python should provide an option to encode explicitly filenames to UTF-8. Or maybe better: encode to UTF-8 by default, with an option to encode to cp437, and another to encode to an arbitrary encoding. Victor 2013/10/15 Alexander Be

Re: [Python-Dev] non-US zip archives support in zipfile.py

2013-10-14 Thread Alexander Belopolsky
On Mon, Oct 14, 2013 at 6:13 PM, Victor Stinner wrote: > I opened an issue proposing exactly the same change, but I didn't provide a > patch. I found this: http://bugs.python.org/issue10614 but it has (seemingly incorrect) patch. Also related: http://bugs.python.org/issue10972 Victor - is an

Re: [Python-Dev] non-US zip archives support in zipfile.py

2013-10-14 Thread Victor Stinner
I opened an issue proposing exactly the same change, but I didn't provide a patch. Thanks for working on the issue. (Sorry I don't know the issue number. Search for "zipfile encoding".) Victor ___ Python-Dev mailing list Python-Dev@python.org https://ma

Re: [Python-Dev] non-US zip archives support in zipfile.py

2013-10-14 Thread Antoine Pitrou
Hello, On Tue, 15 Oct 2013 00:55:05 +0400 Sergey Dorofeev wrote: > Hello, > > I'd like to submit patch to support zip archives created on systems that > use non-US codepage (e.g. russian CP866). > Codepage would be specified in additional parameter of ZipFile > constructor, named "codepage".

[Python-Dev] non-US zip archives support in zipfile.py

2013-10-14 Thread Sergey Dorofeev
Hello, I'd like to submit patch to support zip archives created on systems that use non-US codepage (e.g. russian CP866). Codepage would be specified in additional parameter of ZipFile constructor, named "codepage". If it is not specified, old behavior is preserved (use CP437). --- zipfile.py