STINNER Victor <victor.stin...@haypocalc.com> added the comment:

> I think it would be best to backport the handler (even though 
> it is not needed in Python 2.7), since it makes porting apps 
> to 3.x easier.

surrogateescape should not be used directly be applications. It's used by 
Python3 internals using unicode by default.

I don't know if it's would help porting applications from Python2 to Python3. I 
don't know a use case of surrogateescape in Python2. By default, Python2 uses 
byte string everywhere, especially for filenames, and so it doesn't need any 
unicode error handler.

Another point to consider is that utf8 encoder rejects surrogates in Python3, 
whereas surrogates are accepted by the Python2 utf8 encoder.

I don't have a strong opinion. But if I have to choose, I would say that 
surrogateescape should not go to Python2. It's a solution to problem specific 
to Python3.

(... and surrogates introduces a lot of new issues ...)

----------
nosy: +haypo

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

Reply via email to