New submission from STINNER Victor <victor.stin...@haypocalc.com>:

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.

----------
components: Library (Lib), Unicode
messages: 106339
nosy: haypo, pitrou
priority: normal
severity: normal
status: open
title: Deprecate codecs.open()
versions: Python 3.2, Python 3.3

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue8796>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to