Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #46561

Re: Surprising difference between StringIO.StringIO and io.StringIO

References <CANc-5UyDZ=ArzKrs=Y9CDwNwOunDt3DGpy5KKATZ_R=Z-LsHtA@mail.gmail.com> <20130530231519.GA77870@cskk.homeip.net>
Date 2013-05-30 18:43 -0500
Subject Re: Surprising difference between StringIO.StringIO and io.StringIO
From Skip Montanaro <skip@pobox.com>
Newsgroups comp.lang.python
Message-ID <mailman.2466.1369957812.3114.python-list@python.org> (permalink)

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

>
> I would expect io.StringIO to be a match for the io.* stuff in Python
> 3. So it should care whether it is a binary stream or a text stream.
> Whereas StringIO.StringIO is your good old Python 2 StringIO, which expects
> strs.
>
> On that basis, io.StringIO is a text stream, expecting Unicode
> objects for transcription. 'str' is, in that context, probably
> considered as 'bytes' in Python 3.
>

Thanks.  This example was based on a function in Matplotlib. It appears the
author switched from StringIO.StringIO to io.StringIO between 1.1 and 1.2.

Skip

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Surprising difference between StringIO.StringIO and io.StringIO Skip Montanaro <skip@pobox.com> - 2013-05-30 18:43 -0500

csiph-web