This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: TypeError using tarfile.addfile() with io.StringIO replacing StringIO.StringIO()
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.3
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: Firstname.Lastname, r.david.murray
Priority: normal Keywords:

Created on 2013-05-07 19:18 by Firstname.Lastname, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
showbug.py Firstname.Lastname, 2013-05-07 19:18 demonstration
Messages (3)
msg188682 - (view) Author: Firstname Lastname (Firstname.Lastname) Date: 2013-05-07 19:18
Trying to work with tarfile library and python 3.3 (Ubuntu 13.04 64-bit)

While everything works quite well using StringIO.StringIO() and python 2.7.4, the equivalent code with io.StringIO() and python 3.3.1 doesn't. Is that a bug or am I doing something wrong ?
msg188684 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2013-05-07 20:07
Basic questions like this aren't really suitable for the tracker, you should use other forums such as the python-list mailing list or the #python irc channel.

In Python3, bytes and strings are different classes, but in Python2 they are not.  You need to be working with BytesIO.
msg188685 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2013-05-07 20:11
Bah, I should reread my messages *before* I hit submit.  A better phrasing would be "questions like this aren't what the tracker is intended to answer, you will get more and better help from..." :)

(The bytes/string split is the most important thing to understand about python3 vs python2.)
History
Date User Action Args
2022-04-11 14:57:45adminsetgithub: 62129
2013-05-07 20:11:15r.david.murraysetmessages: + msg188685
2013-05-07 20:07:35r.david.murraysetstatus: open -> closed

nosy: + r.david.murray
messages: + msg188684

resolution: not a bug
stage: resolved
2013-05-07 19:18:21Firstname.Lastnamecreate