Message216984
I ran into a related issue with the gettarinfo() method. Would that fall under the scope of this bug, or should I raise a separate one?
>>> with tarfile.open("/dev/null", "w") as tar:
... with open(b"/bin/sh", "rb") as file:
... tar.gettarinfo(fileobj=file)
...
Traceback (most recent call last):
File "<stdin>", line 3, in <module>
File "/usr/lib/python3.4/tarfile.py", line 1768, in gettarinfo
arcname = arcname.replace(os.sep, "/")
TypeError: expected bytes, bytearray or buffer compatible object
I realise that making TarInfo object with a byte string or integer as a file name is not a good idea. Perhaps the documentation should explicitly say that “fileobj.name” must be a real unencoded file name string unless “arcname” is also given. In my particular case I added arcname="", because my code generates the proper file name later on. |
|
Date |
User |
Action |
Args |
2014-04-22 04:34:31 | martin.panter | set | recipients:
+ martin.panter, lars.gustaebel, eric.araujo, r.david.murray, serhiy.storchaka, eryksun, antoine.pietri |
2014-04-22 04:34:31 | martin.panter | set | messageid: <1398141271.58.0.566913183651.issue21044@psf.upfronthosting.co.za> |
2014-04-22 04:34:31 | martin.panter | link | issue21044 messages |
2014-04-22 04:34:31 | martin.panter | create | |
|