I have a little script which shall extract a .zip-file.
This works well, but only for .zip-files which doesn’t contain files with letters like “ä”, “ö”, “ü” (and so on) in their filenames.
Otherwise I get this error:
Exception in thread Thread-1:
Traceback (most recent call last):
File "threading.pyc", line 552, in __bootstrap_inner
File "install.py", line 92, in run
File "zipfile.pyc", line 962, in extractall
File "zipfile.pyc", line 950, in extract
File "zipfile.pyc", line 979, in _extract_member
File "ntpath.pyc", line 108, in join
UnicodeDecodeError: 'ascii' codec can't decode byte 0x94 in position 32: ordinal not in range(128)
Here is the extracting part of my script:
zip = zipfile.ZipFile(path1)
zip.extractall(path2)
How can I solve this?
one suggestion:
I get the error when I do that:
There is a unicode string passed to join somewhere.
Could it be the file path of the zipfile is encoded in unicode?
What if you do this:
or this:
This is line 128 in ntpath:
Second Suggestion: