Jens Diemer <[email protected]> added the comment:
I have the same problem, using distutils (and not distutils2):
Traceback (most recent call last):
File "./setup.py", line 60, in <module>
test_suite="creole.tests.run_all_tests",
File "/usr/lib/python2.7/distutils/core.py", line 152, in setup
dist.run_commands()
File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File
"/home/jens/python2creole_env/local/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/setuptools/command/sdist.py",
line 147, in run
File "/usr/lib/python2.7/distutils/command/sdist.py", line 448, in
make_distribution
owner=self.owner, group=self.group)
File "/usr/lib/python2.7/distutils/cmd.py", line 392, in make_archive
owner=owner, group=group)
File "/usr/lib/python2.7/distutils/archive_util.py", line 237, in make_archive
filename = func(base_name, base_dir, **kwargs)
File "/usr/lib/python2.7/distutils/archive_util.py", line 101, in make_tarball
tar = tarfile.open(archive_name, 'w|%s' % tar_compression[compress])
File "/usr/lib/python2.7/tarfile.py", line 1687, in open
_Stream(name, filemode, comptype, fileobj, bufsize),
File "/usr/lib/python2.7/tarfile.py", line 431, in __init__
self._init_write_gz()
File "/usr/lib/python2.7/tarfile.py", line 459, in _init_write_gz
self.__write(self.name + NUL)
File "/usr/lib/python2.7/tarfile.py", line 475, in __write
self.buf += s
UnicodeDecodeError: 'ascii' codec can't decode byte 0x8b in position 1: ordinal
not in range(128)
The Problem seems that tarfile._Stream() can't handle 'name' as unicode. With
this changes, it works:
class _Stream:
...
def __init__(self, name, mode, comptype, fileobj, bufsize):
...
self.name = str(name) or ""
++++ +
Don't know it this is related to the usage of: from __future__ import
unicode_literals ?
----------
components: +Distutils
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue11638>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com