This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author jens
Recipients RonnyPfannschmidt, alexis, eric.araujo, jens, tarek
Date 2011-10-05.10:13:24
SpamBayes Score 1.1689538e-12
Marked as misclassified No
Message-id <1317809606.42.0.655470832066.issue11638@psf.upfronthosting.co.za>
In-reply-to
Content
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 ?
History
Date User Action Args
2011-10-05 10:13:26jenssetrecipients: + jens, tarek, eric.araujo, RonnyPfannschmidt, alexis
2011-10-05 10:13:26jenssetmessageid: <1317809606.42.0.655470832066.issue11638@psf.upfronthosting.co.za>
2011-10-05 10:13:25jenslinkissue11638 messages
2011-10-05 10:13:24jenscreate