Re: [Python-Dev] Python 3.5 now uses surrogateescape for the POSIX locale

2014-03-18 Thread Stephen J. Turnbull
Victor Stinner writes: > 2014-03-18 11:02 GMT+01:00 Atsuo Ishimoto : > > FYI: Guido was opposed to change error handler of stdin and > > stdout years ago. > > > > http://bugs.python.org/issue2630#msg65493 > > This issue proposes to use "backslashreplace" error handler for > stdout. This er

Re: [Python-Dev] Python 3.5 now uses surrogateescape for the POSIX locale

2014-03-18 Thread Atsuo Ishimoto
Hello, 2014-03-18 18:13 GMT+09:00 Victor Stinner : > I'm not against backporting the change in Python 3.4.1. It can be seen > as a bugfix. I don't think that anyone wants a Unicode error when > reading or printing non-ASCII data from stdin/to stdout. But I would > like the opinion of other develo

Re: [Python-Dev] Python 3.5 now uses surrogateescape for the POSIX locale

2014-03-18 Thread Victor Stinner
2014-03-18 11:02 GMT+01:00 Atsuo Ishimoto : > FYI: Guido was opposed to change error handler of stdin and stdout years ago. > > http://bugs.python.org/issue2630#msg65493 This issue proposes to use "backslashreplace" error handler for stdout. This error handler is very different to "surrogateescape

Re: [Python-Dev] Python 3.5 now uses surrogateescape for the POSIX locale

2014-03-18 Thread Victor Stinner
2014-03-18 10:48 GMT+01:00 Nick Coghlan : > Well, the concern has always been the risk of silently generating bad > data if there is a mismatch between the OS encoding and the stream > encodings. Data can be loaded from OS functions, from files and from stdin. These 3 sources may use various diffe

Re: [Python-Dev] Python 3.5 now uses surrogateescape for the POSIX locale

2014-03-18 Thread Nick Coghlan
On 18 March 2014 19:13, Victor Stinner wrote: > 2014-03-18 9:08 GMT+01:00 Nick Coghlan : >> On 18 Mar 2014 11:56, "Victor Stinner" wrote: >>> >>> Hi, >>> >>> I modified Python 3.5 to use the "surrogateescape" error handler (PEP >>> 383) for stdin and stdout when the LC_CTYPE locale is POSIX ("C"

Re: [Python-Dev] Python 3.5 now uses surrogateescape for the POSIX locale

2014-03-18 Thread Victor Stinner
2014-03-18 9:08 GMT+01:00 Nick Coghlan : > On 18 Mar 2014 11:56, "Victor Stinner" wrote: >> >> Hi, >> >> I modified Python 3.5 to use the "surrogateescape" error handler (PEP >> 383) for stdin and stdout when the LC_CTYPE locale is POSIX ("C" >> locale): >> http://bugs.python.org/issue19977 > > Ya

Re: [Python-Dev] Python 3.5 now uses surrogateescape for the POSIX locale

2014-03-18 Thread Nick Coghlan
On 18 Mar 2014 11:56, "Victor Stinner" wrote: > > Hi, > > I modified Python 3.5 to use the "surrogateescape" error handler (PEP > 383) for stdin and stdout when the LC_CTYPE locale is POSIX ("C" > locale): > http://bugs.python.org/issue19977 Yay, thanks Victor. I'll let the Fedora folks know this

[Python-Dev] Python 3.5 now uses surrogateescape for the POSIX locale

2014-03-17 Thread Victor Stinner
Hi, I modified Python 3.5 to use the "surrogateescape" error handler (PEP 383) for stdin and stdout when the LC_CTYPE locale is POSIX ("C" locale): http://bugs.python.org/issue19977 New behaviour: --- $ mkdir z $ touch z/abcé $ LC_CTYPE=C ./python -c 'import os; print(os.listdir("z")[0])' abcé --