New submission from Serhiy Storchaka <storch...@gmail.com>:

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.

----------
assignee: docs@python
components: Documentation, IO, Library (Lib)
messages: 164142
nosy: docs@python, storchaka
priority: normal
severity: normal
status: open
title: Deprecate the 'U' open mode
type: behavior
versions: Python 3.3

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

Reply via email to