[Debian-l10n-devel] Bug#643008: translate-toolkit: Module zipfileext breaks zipfiles with non-ascii subfiles
Emmanuel Hainry
ehainry at free.fr
Mon Sep 26 13:04:03 UTC 2011
Package: translate-toolkit
Version: 1.9.0-1
Severity: normal
Dear Maintainer,
I use the zipfileext python module from translate-toolkit to modify in place
zip archives. Unfortunately, when a file inside the archive has a
non-ascii name, it fails and worse breaks the archive.
Example:
$ touch blé blï
$ zip test.zip blé blï
$ echo "import translate.misc.zipfileext as zipfileext
zz = zipfileext.ZipFileExt('test.zip', 'a')
zz.close()" | python
Traceback (most recent call last):
File "<stdin>", line 3, in <module>
File "/usr/lib/python2.6/dist-packages/translate/misc/zipfileext.py", line 84, in close
self.writeendrec()
File "/usr/lib/python2.6/dist-packages/translate/misc/zipfileext.py", line 108, in writeendrec
self.fp.write(zinfo.filename)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 2: ordinal not in range(128)
Exception UnicodeEncodeError: UnicodeEncodeError('ascii', u'bl\xe9', 2, 3, 'ordinal not in range(128)') in <bound method ZipFileExt.__del__ of <translate.misc.zipfileext.ZipFileExt object at 0x7f3eaa3d1950>> ignored
$ zip -T test.zip
zip warning: expected 2 entries but found 1
zip error: Zip file structure invalid (test.zip)
$
-- System Information:
Debian Release: wheezy/sid
APT prefers unstable
APT policy: (700, 'unstable'), (650, 'testing'), (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)
Kernel: Linux 3.0.0-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages translate-toolkit depends on:
ii gettext 0.18.1.1-4
ii python 2.6.7-3
ii python2.6 2.6.7-4
ii python2.7 2.7.2-5
Versions of packages translate-toolkit recommends:
ii iso-codes 3.28-1
ii python-aeidon 0.19.1-1
ii python-enchant 1.6.5-2
ii python-iniparse 0.4-2.1
ii python-levenshtein 0.10.1-1.1+b1
ii python-lxml 2.3-0.1+b2
ii python-simplejson 2.2.0-1
ii python-utidylib 0.2-8
ii python-vobject 0.8.1c-4
Versions of packages translate-toolkit suggests:
pn translate-toolkit-dev-doc <none>
-- no debconf information
More information about the Debian-l10n-devel
mailing list