[issue13664] UnicodeEncodeError in gzip when filename contains non-ascii

2014-10-17 Thread Terry J. Reedy

Terry J. Reedy added the comment:

test_gzip passed after this patch.

--
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13664
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13664] UnicodeEncodeError in gzip when filename contains non-ascii

2014-10-13 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Ah, ASCII locale...

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13664
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13664] UnicodeEncodeError in gzip when filename contains non-ascii

2014-10-13 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7657cc08d29b by Serhiy Storchaka in branch '2.7':
Fixed the test of issue #13664 on platforms without unicode filenames support.
https://hg.python.org/cpython/rev/7657cc08d29b

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13664
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13664] UnicodeEncodeError in gzip when filename contains non-ascii

2014-10-12 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
assignee:  - serhiy.storchaka

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13664
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13664] UnicodeEncodeError in gzip when filename contains non-ascii

2014-10-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I there are no objections I'll commit the patch soon.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13664
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13664] UnicodeEncodeError in gzip when filename contains non-ascii

2014-10-12 Thread Terry J. Reedy

Terry J. Reedy added the comment:

fine with me

--
stage: patch review - commit review

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13664
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13664] UnicodeEncodeError in gzip when filename contains non-ascii

2014-10-12 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 272c78c9c47e by Serhiy Storchaka in branch '2.7':
Issue #13664: GzipFile now supports non-ascii Unicode filenames.
https://hg.python.org/cpython/rev/272c78c9c47e

--
nosy: +python-dev

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13664
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13664] UnicodeEncodeError in gzip when filename contains non-ascii

2014-10-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you Terry for the review.

--
resolution:  - fixed
stage: commit review - resolved
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13664
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13664] UnicodeEncodeError in gzip when filename contains non-ascii

2014-10-12 Thread koobs

koobs added the comment:

This broke a FreeBSD buildbot (koobs-freebsd10), complete log attached.

--
nosy: +koobs
Added file: http://bugs.python.org/file36893/koobs-freebsd10-build-742.log

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13664
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13664] UnicodeEncodeError in gzip when filename contains non-ascii

2014-10-12 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
status: closed - open

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13664
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13664] UnicodeEncodeError in gzip when filename contains non-ascii

2014-10-12 Thread koobs

koobs added the comment:

koobs@10-STABLE-amd64:~ % locale
LANG=
LC_CTYPE=C
LC_COLLATE=C
LC_TIME=C
LC_NUMERIC=C
LC_MONETARY=C
LC_MESSAGES=C
LC_ALL=

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13664
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13664] UnicodeEncodeError in gzip when filename contains non-ascii

2014-10-12 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I rechecked and test_gzip passes on 2.7 Win7, I checked revision history and 
this is the only gzip or test_gzip patch for several months.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13664
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13664] UnicodeEncodeError in gzip when filename contains non-ascii

2014-10-02 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

 The actual fix in the previous issue, as in Python 3, was to always write the 
 filename, but with errors replaced with '?/.

Filename is optional in gzip file. If it can't be encoded to Latin1, it should 
be just omitted.

Here is a patch which backports the solution from Python 3 (accumulated 
f37016d42729, fb069eafaf89, 8cff949323c9, and e044fa016c85).

--
keywords: +patch
nosy: +nadeem.vawda, serhiy.storchaka
stage:  - patch review
type:  - behavior
Added file: http://bugs.python.org/file36784/gzip_unicode_filename-2.7.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13664
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13664] UnicodeEncodeError in gzip when filename contains non-ascii

2011-12-30 Thread Terry J. Reedy

Terry J. Reedy tjre...@udel.edu added the comment:

The actual fix in the previous issue, as in Python 3, was to always write the 
filename, but with errors replaced with '?/.

--
nosy: +lars.gustaebel, terry.reedy

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13664
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13664] UnicodeEncodeError in gzip when filename contains non-ascii

2011-12-26 Thread Jason R. Coombs

New submission from Jason R. Coombs jar...@jaraco.com:

While investigating #11638, I encountered another encoding issue related to 
tarballs. Consider this command:

python -c import gzip; gzip.GzipFile(u'\xe5rchive', 'w', 
fileobj=open(u'\xe5rchive', 'wb'))

When run, it triggers the following traceback:

Traceback (most recent call last):
  File string, line 1, in module
  File c:\python\lib\gzip.py, line 127, in __init__
self._write_gzip_header()
  File c:\python\lib\gzip.py, line 172, in _write_gzip_header
self.fileobj.write(fname + '\000')
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe5' in position 0: 
ordinal not in range(128)

Based on the resolution of #13639, I believe the recommended fix is to handle 
unicode here much like Python 3 does--specifically, detect unicode, encode to 
'latin-1' if possible or leave the filename blank if not.

--
messages: 150265
nosy: jason.coombs
priority: low
severity: normal
status: open
title: UnicodeEncodeError in gzip when filename contains non-ascii
versions: Python 2.7

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13664
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13664] UnicodeEncodeError in gzip when filename contains non-ascii

2011-12-26 Thread Jason R. Coombs

Changes by Jason R. Coombs jar...@jaraco.com:


--
components: +Library (Lib)

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13664
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com