[issue19058] test_sys.test_ioencoding_nonascii() fails with ASCII locale encoding

2015-10-14 Thread STINNER Victor
STINNER Victor added the comment: > What could you say about the recent patch Victor? I'm not sure that it works in all cases. io.TextIOWrapper doesn't care to normalize the encoding name. You should use something like: encoding = codecs.lookup(encoding).name Otherwise, the test can fail i

[issue19058] test_sys.test_ioencoding_nonascii() fails with ASCII locale encoding

2015-10-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: What could you say about the recent patch Victor? -- ___ Python tracker ___ ___ Python-bugs-list m

[issue19058] test_sys.test_ioencoding_nonascii() fails with ASCII locale encoding

2013-09-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > Your patch does not check sys.stdout.encoding, but check directly the codec. > Two codecs may encode the same character as the same byte sequence. Checking encoding name is too rigid. Python interpreter can normalize encoding name before assigning it to st

[issue19058] test_sys.test_ioencoding_nonascii() fails with ASCII locale encoding

2013-09-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > Your test is skipped if the locale encoding is ASCII, whereas the purpopse of > PYTHONIOENCODING is to write non-ASCII characters without having to care of > the locale encoding. This case was tested in previous test. > If you really want to check the cod

[issue19058] test_sys.test_ioencoding_nonascii() fails with ASCII locale encoding

2013-09-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is a patch which directly checks sys.std* attributes. -- Added file: http://bugs.python.org/file31899/sys_test_ioencoding.patch ___ Python tracker __

[issue19058] test_sys.test_ioencoding_nonascii() fails with ASCII locale encoding

2013-09-28 Thread STINNER Victor
STINNER Victor added the comment: > Here is a patch. It uses same algorithm to obtain encodable > non-ASCII string as for FS_NONASCII, but with locale encoding. > It also adds new tests and simplifies existing tests. I don't like your patch. The purpose of PYTHONIOENCODING is to set sys.stdin/s

[issue19058] test_sys.test_ioencoding_nonascii() fails with ASCII locale encoding

2013-09-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Indeed. Here is a patch. It uses same algorithm to obtain encodable non-ASCII string as for FS_NONASCII, but with locale encoding. It also adds new tests and simplifies existing tests. -- keywords: +patch stage: needs patch -> patch review Added fil

[issue19058] test_sys.test_ioencoding_nonascii() fails with ASCII locale encoding

2013-09-24 Thread R. David Murray
R. David Murray added the comment: Also note that on OS X I believe the fsencoding is always utf-8, but the locale can of course be something else. -- ___ Python tracker ___ ___

[issue19058] test_sys.test_ioencoding_nonascii() fails with ASCII locale encoding

2013-09-24 Thread STINNER Victor
STINNER Victor added the comment: Shouldn't FS_NONASCII be None with ASCII locale encoding? See the description of the variable in test.support: # FS_NONASCII: non-ASCII character encodable by os.fsencode(), # or None if there is no such character. The file system encoding an the locale encodi

[issue19058] test_sys.test_ioencoding_nonascii() fails with ASCII locale encoding

2013-09-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Shouldn't FS_NONASCII be None with ASCII locale encoding? -- ___ Python tracker ___ ___ Python-bug

[issue19058] test_sys.test_ioencoding_nonascii() fails with ASCII locale encoding

2013-09-24 Thread STINNER Victor
Changes by STINNER Victor : -- title: test_ioencoding_nonascii (test_sys) fails on Snow Leopard -> test_sys.test_ioencoding_nonascii() fails with ASCII locale encoding ___ Python tracker __