[issue7693] tarfile.extractall can't have unicode extraction path

Ezio Melotti report at bugs.python.org
Thu Jan 14 02:15:38 CET 2010


Ezio Melotti <ezio.melotti at gmail.com> added the comment:

When test.tar is opened, the filename is read as a string, so when os.path.join() is called in self._extract_member(tarinfo, os.path.join(path, tarinfo.name)), path is u'.' and tarinfo.name is '\xea\x80\x80a.ogg'.
tarinfo.name is a byte string, so in os.path.join it is converted implicitly to Unicode using the ascii codec because the path is unicode and since it contains non-ascii chars the error is raised.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue7693>
_______________________________________


More information about the Python-bugs-list mailing list