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.

Author vstinner
Recipients pitrou, vstinner
Date 2010-05-23.19:27:52
SpamBayes Score 0.002494805
Marked as misclassified No
Message-id <1274642875.55.0.470910509558.issue8796@psf.upfronthosting.co.za>
In-reply-to
Content
codecs module (and codecs.open() function) was added to Python 2.0. codecs.open() creates a StreamReaderWriter object which use two other objects: StreamReader and StreamWriter.

Python 2.6 and 3.0 have a new API: the io module. io.open() creates a TextIOWrapper object which is fully compatible with the file object API (it *is* the (text) file object API :-)). TextIOWrapper supports univeral newline and does better support reading+writing than StreamReaderWriter. TextIOWrapper has a better test suite and is used by default to read and write text files in Python3 (since Python 3.0). The io module has an *optimized* design and the io module was rewritten in C (in Python 2.7 and 3.1).

codecs.open() should be deprecated in Python 3.2 and removed in Python 3.3 (not in Python 2.7). Maybe also StreamReader, StreamWriter and StreamReaderWriter: I don't know if any program use directly these classes, but I think that TextIOWrapper can be used instead.
History
Date User Action Args
2010-05-23 19:27:55vstinnersetrecipients: + vstinner, pitrou
2010-05-23 19:27:55vstinnersetmessageid: <1274642875.55.0.470910509558.issue8796@psf.upfronthosting.co.za>
2010-05-23 19:27:53vstinnerlinkissue8796 messages
2010-05-23 19:27:52vstinnercreate