[issue23453] Opening a stream with tarfile.open() triggers a TypeError: can't concat bytes to str error

Martin Panter report at bugs.python.org
Thu Feb 12 12:30:06 CET 2015


Martin Panter added the comment:

Using fileobj=sys.stdin.buffer instead should do the trick. The “tarfile” module would expect a binary stream, not a text stream.

Given the documentation currently says, “Use this variant in combination with e.g. sys.stdin, . . .”, I presume that is why you were using plain stdin. The documentation should be clarified.

----------
assignee:  -> docs at python
components: +Documentation
nosy: +docs at python, vadmium

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


More information about the Python-bugs-list mailing list