[New-bugs-announce] [issue11638] pysetup un sdist crashes with weird trace if version is unicode by accident

RonnyPfannschmidt report at bugs.python.org
Tue Mar 22 22:18:53 CET 2011

New submission from RonnyPfannschmidt <Ronny.Pfannschmidt at gmx.de>:

i passed in a unicode value as version by accident,
resulted in:

Traceback (most recent call last):
  File "/home/ronny/.local/venvs/clean/bin/pysetup", line 7, in <module>
  File "/home/ronny/Projects/distutils2/distutils2/pysetup", line 5, in <module>
  File "/home/ronny/Projects/distutils2/distutils2/run.py", line 486, in main
    return dispatcher()
  File "/home/ronny/Projects/distutils2/distutils2/run.py", line 477, in __call__
    return func(self, self.args)
  File "/home/ronny/Projects/distutils2/distutils2/run.py", line 166, in _run
    dist.run_command(cmd, dispatcher.command_options[cmd])
  File "/home/ronny/Projects/distutils2/distutils2/dist.py", line 781, in run_command
  File "/home/ronny/Projects/distutils2/distutils2/command/sdist.py", line 183, in run
  File "/home/ronny/Projects/distutils2/distutils2/command/sdist.py", line 327, in make_distribution
    owner=self.owner, group=self.group)
  File "/home/ronny/Projects/distutils2/distutils2/command/cmd.py", line 426, in make_archive
    owner=owner, group=group)
  File "/home/ronny/Projects/distutils2/distutils2/_backport/shutil.py", line 588, in make_archive
    filename = func(base_name, base_dir, **kwargs)
  File "/home/ronny/Projects/distutils2/distutils2/_backport/shutil.py", line 426, in _make_tarball
    tar = tarfile.open(archive_name, 'w|%s' % tar_compression[compress])
  File "/home/ronny/Projects/distutils2/distutils2/_backport/tarfile.py", line 1693, in open
    _Stream(name, filemode, comptype, fileobj, bufsize),
  File "/home/ronny/Projects/distutils2/distutils2/_backport/tarfile.py", line 434, in __init__
  File "/home/ronny/Projects/distutils2/distutils2/_backport/tarfile.py", line 462, in _init_write_gz
    self.__write(self.name + NUL)
  File "/home/ronny/Projects/distutils2/distutils2/_backport/tarfile.py", line 478, in __write
    self.buf += s
UnicodeDecodeError: 'ascii' codec can't decode byte 0x8b in position 1: ordinal not in range(128)

note that i have no idea where the 0x8b is from, if i just pass the version trough str it works (which means something is wrong somewhere else, unicode just triggers it)

assignee: tarek
components: Distutils2
messages: 131781
nosy: RonnyPfannschmidt, alexis, eric.araujo, tarek
priority: normal
severity: normal
status: open
title: pysetup un sdist crashes with weird trace if version is unicode by accident
versions: 3rd party

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list