[issue17153] tarfile extract fails when Unicode in pathname

2021-05-31 Thread Vinay Sajip


Change by Vinay Sajip :


--
resolution:  -> out of date
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17153] tarfile extract fails when Unicode in pathname

2021-05-31 Thread Zackery Spytz


Zackery Spytz  added the comment:

Python 2.7 is no longer supported, so I think this issue should be closed.

--
nosy: +ZackerySpytz

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17153] tarfile extract fails when Unicode in pathname

2016-08-11 Thread Mark Lawrence

Changes by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17153] tarfile extract fails when Unicode in pathname

2016-08-10 Thread Vinay Sajip

Vinay Sajip added the comment:

Could you point to some suitable projects from GitHub whose tarballs fail on 
3.5 / 3.6? My script in the first post, with the replacing of "unicode(...)" 
with "str(...)" and my original failing archive, works on Python 3.5 and 3.6 on 
Linux. Which platform have you seen failures on?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17153] tarfile extract fails when Unicode in pathname

2016-08-10 Thread Vadim Markovtsev

Vadim Markovtsev added the comment:

Relevant issue in pip: https://github.com/pypa/setuptools/issues/710

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17153] tarfile extract fails when Unicode in pathname

2016-08-10 Thread Vadim Markovtsev

Vadim Markovtsev added the comment:

So... The bug persists in 3.5 ad 3.6. It prevents from e.g. unpacking tarballs 
coming from GitHub repos with Unicode file names.

--
nosy: +Vadim Markovtsev2

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17153] tarfile extract fails when Unicode in pathname

2014-07-08 Thread Lars Gustäbel

Lars Gustäbel added the comment:

IIRC, tarfile under 2.7 has never been explicitly unicode-safe, support for 
unicode objects is heterogeneous at best. The obvious work-around is to work 
exclusively with str objects.

What we can't do is to decode the utf-8 pathname from the archive to a unicode 
object, because we have no way to detect an archive's encoding. We can either 
emit a warning if the user passes a unicode object to extract() or we 
implicitly encode the passed unicode object using TarFile.encoding, so that the 
os.path.join() succeeds.

Unfortunately, I am not entirely sure if there was possibly a rationale behind 
the current behaviour of extract(). This needs more inspection.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17153
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17153] tarfile extract fails when Unicode in pathname

2014-06-20 Thread Mark Lawrence

Mark Lawrence added the comment:

@Lars can we have a response on this issue please?

--
nosy: +BreamoreBoy

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17153
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17153] tarfile extract fails when Unicode in pathname

2013-02-08 Thread Hynek Schlawack

Changes by Hynek Schlawack h...@ox.cx:


--
nosy: +hynek

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17153
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17153] tarfile extract fails when Unicode in pathname

2013-02-07 Thread Vinay Sajip

New submission from Vinay Sajip:

The attached file failing.tar.gz contains a path with UTF-8-encoded Unicode. 
This causes extractall() to fail, but only when the destination path is 
Unicode. That's because it leads to a implicit str-unicode conversion using 
ASCII.

Test script:

import shutil, tarfile, tempfile

tf = tarfile.open('failing.tar.gz', 'r:gz')
workdir = tempfile.mkdtemp()
try:
# N.B. ensure dest path is Unicode to trigger the failure
tf.extractall(unicode(workdir))
finally:
shutil.rmtree(workdir)

Result:

$ python untar.py
Traceback (most recent call last):
  File untar.py, line 8, in module
tf.extractall(unicode(workdir))
  File /usr/lib/python2.7/tarfile.py, line 2046, in extractall
self.extract(tarinfo, path)
  File /usr/lib/python2.7/tarfile.py, line 2083, in extract
self._extract_member(tarinfo, os.path.join(path, tarinfo.name))
  File /usr/lib/python2.7/posixpath.py, line 71, in join
path += '/' + b
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 44: 
ordinal not in range(128)

--
components: Library (Lib), Unicode
messages: 181631
nosy: ezio.melotti, vinay.sajip
priority: normal
severity: normal
status: open
title: tarfile extract fails when Unicode in pathname
type: behavior
versions: Python 2.7

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17153
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17153] tarfile extract fails when Unicode in pathname

2013-02-07 Thread Vinay Sajip

Changes by Vinay Sajip vinay_sa...@yahoo.co.uk:


Added file: http://bugs.python.org/file28988/failing.tar.gz

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17153
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17153] tarfile extract fails when Unicode in pathname

2013-02-07 Thread Vinay Sajip

Changes by Vinay Sajip vinay_sa...@yahoo.co.uk:


--
nosy: +lars.gustaebel

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17153
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com