Opened 16 years ago
Closed 16 years ago
#9782 closed (invalid)
'utf8' codec can't decode byte 0x97 in position 11: unexpected code byte
Reported by: | akash | Owned by: | nobody |
---|---|---|---|
Component: | Uncategorized | Version: | 1.0 |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
UnicodeDecodeError at /mysite/download/zip/123/
'utf8' codec can't decode byte 0x97 in position 11: unexpected code byte
Request Method: POST
Request URL: http://IP/mysite/download/zip/123/
Exception Type: UnicodeDecodeError
Exception Value:
'utf8' codec can't decode byte 0x97 in position 11: unexpected code byte
Exception Location: /usr/lib/python2.4/zipfile.py in FileHeader, line 166
Python Executable: /usr/bin/python
Python Version: 2.4.3
Python Path: ['/var/opt/project', '/usr/lib/python2.4/site-packages/pytz-2006p-py2.4.egg', '/usr/lib/python2.4/site-packages/simplejson-1.4-py2.4.egg', '/usr/lib/python2.4/site-packages/pydot-1.0.2-py2.4.egg', '/usr/lib/python24.zip', '/usr/lib/python2.4', '/usr/lib/python2.4/plat-linux2', '/usr/lib/python2.4/lib-tk', '/usr/lib/python2.4/lib-dynload', '/usr/lib/python2.4/site-packages', '/usr/lib/python2.4/site-packages/Numeric', '/usr/lib/python2.4/site-packages/PIL', '/usr/lib/python2.4/site-packages/gtk-2.0', '/usr/lib/python2.4/site-packages/setuptools-0.6c1-py2.4.egg']
Server time: Tue, 9 Dec 2008 18:57:47 +0530
Unicode error hint
The string that could not be encoded/decoded was: �7��9���
header : 'PK\x03\x04\x14\x00\x00\x00\x08\x007\x97\x899\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11\x00\x00\x00'
I am trying to zip a folder and getting the above error.
##Sample Code
zp = zipfile.ZipFile(zip_path, "w")
for name in glob.glob(path_till_title + "/*"):
zp.write(name, os.path.basename(name), zipfile.ZIP_DEFLATED)
zp.close()
while doing the same from command line it works.
I don't see the Django bug here. You haven't provided any steps to repeat the problem or indicate what you are doing with Django. It all seems to be related to the zip module and the type of data/string you are passing in.
If you don't have a short repeatable example to demonstrate the problem, you might want to explain the problem you're having on the django-users list and somebody might be able to help. But, at the moment, I don't see that there's any bug here. So I'm closing for now.