Author serhiy.storchaka
Recipients docs@python, serhiy.storchaka
Date 2012-06-27.10:29:50
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1340792991.22.0.497199331706.issue15204@psf.upfronthosting.co.za>
In-reply-to
Content
Since Python 2.3 many open functions supports "Universal line mode" (PEP 278). Since 3.0 (and 2.6) PEP 3116 suggests better alternative -- io.TextWrapper.

Now support for the 'U' mode in the different open functions is heterogeneous. Some functions simply ignore the 'U' mode (but accept it), others perceive it as a synonym for text-mode, others just pass it on lower lever, other attempt to implement it, but the implementation is obtained imperfect and contradictory (as in ZipExtFile). The documentation for built-in open does not advise the use of the 'U' mode. The 'U' mode support cumbersome. I propose to deprecate the 'U' mode. If someone wanted to work with the universal line support, he'll surely need to work with encodings too, and io.TextWrapper provides is better choise.

The deprecation plan for the 'U' mode of open functions might be as follow:

3.3.  Deprecating the 'U' mode in docs for all opens (building open, io.open, codecs.open, gzip.open, ZipFile.open, etc). Add suggestion about io.TextWrapper.
3.4.  Raise a warning on use of the 'U' mode.
3.5.  Raise an exception on use of the 'U' mode.
3.6 (or 4.0?).  Remove the 'U' mode processing code.

As the first stage involves only the changes to the documentation, I hope deprecation can starts in 3.3.
History
Date User Action Args
2012-06-27 10:29:51serhiy.storchakasetrecipients: + serhiy.storchaka, docs@python
2012-06-27 10:29:51serhiy.storchakasetmessageid: <1340792991.22.0.497199331706.issue15204@psf.upfronthosting.co.za>
2012-06-27 10:29:50serhiy.storchakalinkissue15204 messages
2012-06-27 10:29:50serhiy.storchakacreate