[New-bugs-announce] [issue8396] tarfile.open does fails with UnicodeDecodeError if parent dir is unicode

Parth Malwankar report at bugs.python.org
Wed Apr 14 11:50:03 CEST 2010


New submission from Parth Malwankar <parth.malwankar at gmail.com>:

If any directory higher up in the hierarchy contains unicode chars, tarfile.open fails with UnicodeDecodeError. Attached script reproduces this error.

[tmp]% python tarfilefail.py 
Traceback (most recent call last):
  File "tarfilefail.py", line 9, in <module>
    tarfile.open(file_name, 'w')
  File "/usr/lib/python2.6/tarfile.py", line 1682, in open
    return cls.taropen(name, mode, fileobj, **kwargs)
  File "/usr/lib/python2.6/tarfile.py", line 1692, in taropen
    return cls(name, mode, fileobj, **kwargs)
  File "/usr/lib/python2.6/tarfile.py", line 1527, in __init__
    self.name = os.path.abspath(name) if name else None
  File "/usr/lib/python2.6/posixpath.py", line 338, in abspath
    path = join(os.getcwd(), path)
  File "/usr/lib/python2.6/posixpath.py", line 70, in join
    path += '/' + b
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 17: ordinal not in range(128)
[tmp]%

----------
files: tarfilefail.py
messages: 103117
nosy: parthm
severity: normal
status: open
title: tarfile.open does fails with UnicodeDecodeError if parent dir is unicode
versions: Python 2.6
Added file: http://bugs.python.org/file16922/tarfilefail.py

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


More information about the New-bugs-announce mailing list