Only pass str paths to tarfile; unicode causes trouble
commit1a7b58e8488aa34223a9469ccff6862ef7726bfb
authorThomas Leonard <talex5@gmail.com>
Sat, 10 Jul 2010 13:15:53 +0000 (10 14:15 +0100)
committerThomas Leonard <talex5@gmail.com>
Sat, 10 Jul 2010 13:15:53 +0000 (10 14:15 +0100)
treed10e2da93027012c8b9882892cb3b5a8520c1fb7
parent1e5f0f0428d6463a05a8f7bcf3d25205464eb74b
Only pass str paths to tarfile; unicode causes trouble

Typical error:

Traceback (most recent call last):
  File "./0export", line 229, in <module>
    setup_tar.add(impl, 'implementations/' + os.path.basename(impl))
  File "/usr/lib/python2.5/tarfile.py", line 1475, in add
    self.addfile(tarinfo, f)
  File "/usr/lib/python2.5/tarfile.py", line 1499, in addfile
    self.fileobj.write(buf)
  File "/usr/lib/python2.5/tarfile.py", line 402, in write
    self.__write(s)
  File "/usr/lib/python2.5/tarfile.py", line 408, in __write
    self.buf += s
UnicodeDecodeError: 'ascii' codec can't decode byte 0xf9 in position 0: ordinal not in range(128)
0export