[issue21044] tarfile does not handle file .name being an int

Antoine Pietri report at bugs.python.org
Sat Apr 5 22:26:05 CEST 2014


Antoine Pietri added the comment:

Well, that seems complicated: you can't overwrite a io.FileIO().name attribute, and doing so would be nonsensical for tarfile, which would try to perform IO operations on a random file descriptor... Also, I can't think of any case where a .name attribute could actually be bytes (I was just mirroring the code in msg214670).

Here's a patch that tries all combinations of encoding for writing, but I can't see a way to enforce manually the name attribute being an int, even for this test purposes.

----------
Added file: http://bugs.python.org/file34739/test_tarfile_all_modes.diff

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21044>
_______________________________________


More information about the Python-bugs-list mailing list