[Python-3000] Removal of cStringIO and StringIO module

Brett Cannon brett at python.org
Wed Aug 8 22:07:54 CEST 2007


On 8/8/07, Christian Heimes <lists at cheimes.de> wrote:
> I've spent some free time today to work on a patch that removes
> cStringIO and StringIO from the py3k-struni branch. The patch is
> available at http://www.python.org/sf/1770008
>

Thanks for the work!  And with Alexandre's Summer of Code project to
have a C version of io.StringIO that is used transparently that should
work out well!

> It adds a deprecation warning to StringIO.py and a facade cStringIO.py.
> Both modules act as an alias for io.StringIO. You may remove the files.
> I didn't noticed that 2to3 has a fixer for cStringIO and StringIO. But
> the files may be useful because the fixer doesn't fix doc tests.
>

Deprecation warnings for modules that are going away has not been
handled yet.  Stdlib stuff is on the table for after 3.0a1.  Chances
are the stdlib deprecations will be a 2.6 thing and 3.0 won't have any
since we expect people to go 2.6 -> 3.0, not the other way around.
There will be 2to3 fixers for the imports, but not until we tackle the
stdlib and its cleanup.

> Some unit tests are failing because I don't know how to handle
> StringIO(buffer()). Georg Brandl suggested to use io.BytesIO but that
> doesn't work correctly.

Really?  I did that in a couple of places and it worked for me.
What's the problem specifically?

-Brett


More information about the Python-3000 mailing list