Le 01/08/2012 02:37, wgoulet a écrit :
But does that work for binary data? In my application I'm processing
zipfiles and Java keystore files. My read of StringIO is that it works
great for anything that can be directly represented as ASCII or Unicode,
but it seems like a lot of overhead to base64 encode something so I can
store it in memory.

On Python 2.x, StringIO.StringIO can accept either bytes or Unicode as long as you don’t mix them. To be safe (and ready for Python 3) you can use io.BytesIO instead if you’re on Python 2.6 or 2.7:

http://docs.python.org/library/stringio.html
http://docs.python.org/library/io.html#io.BytesIO

--
Simon Sapin

--
You received this message because you are subscribed to the Google Groups 
"pocoo-libs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pocoo-libs?hl=en.

Reply via email to