Tres Seaver wrote:
>> Perhaps we could also add a warning to the open() API which warns
>> in case a file is opened in text mode without specifying an
>> encoding ?!
> 
> That ounds like a good plan to me, given that backward-compatibility
> requires keeping the guessing enabled by default.

Perhaps a switch along the lines of -t and -tt (warnings/errors for
mixing tabs and spaces)?

So by default Python continues to guess based on the locale encoding
(perhaps with a PYTHONTEXTENCODING to override the locale specifically
for Python).

Then -T might warn whenever a text file encoding is guessed rather than
specified and -TT might raise an error.

Regards,
Nick.
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/ncoghlan%40gmail.com



-- 
Nick Coghlan   |   ncogh...@gmail.com   |   Brisbane, Australia
---------------------------------------------------------------
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to