[issue15441] test_posixpath fails on Japanese edition of Windows

2012-10-31 Thread Roundup Robot
Roundup Robot added the comment: New changeset b3434c1ae503 by Victor Stinner in branch 'default': Issue #15441, #15478: Reenable test_nonascii_abspath() on Windows http://hg.python.org/cpython/rev/b3434c1ae503 -- ___ Python tracker

[issue15441] test_posixpath fails on Japanese edition of Windows

2012-10-31 Thread STINNER Victor
STINNER Victor added the comment: If a file name was invalid byte character, os.chdir() raises UnicodeDecodeError() instead of WindowsError. I believe this case is not handled correctly in Python 3.4 (version under development) thanks to my work on issue #15478. Thanks for the report Atsuo

[issue15441] test_posixpath fails on Japanese edition of Windows

2012-08-01 Thread Roundup Robot
Roundup Robot added the comment: New changeset 3edc71ed19e7 by Victor Stinner in branch 'default': Issue #15441: Skip test_nonascii_abspath() of test_genericpath on Windows http://hg.python.org/cpython/rev/3edc71ed19e7 -- nosy: +python-dev ___ Python

[issue15441] test_posixpath fails on Japanese edition of Windows

2012-08-01 Thread STINNER Victor
STINNER Victor added the comment: This issue (the test) should be fixed, see the issue #15478 for the real fix. -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15441

[issue15441] test_posixpath fails on Japanese edition of Windows

2012-07-28 Thread STINNER Victor
STINNER Victor victor.stin...@gmail.com added the comment: I still would prefer if only one issue at a time gets fixed, in particular if the two issues require independent changes. Sorry, you are right: I created the issue #15478 for the general fix, and we will use this issue to fix

[issue15441] test_posixpath fails on Japanese edition of Windows

2012-07-26 Thread STINNER Victor
STINNER Victor victor.stin...@gmail.com added the comment: +@unittest.skipIf(sys.platform == 'win32', +Win32 can fail cwd() with invalid utf8 name) def test_nonascii_abspath(self): You should not always skip the test on Windows: the filename is decodable in code pages other

[issue15441] test_posixpath fails on Japanese edition of Windows

2012-07-26 Thread Atsuo Ishimoto
Atsuo Ishimoto ishim...@gembook.org added the comment: chcp does only change the OEM code page, whereas Python uses the ANSI code page for sys.getfilesystemencoding(). Sorry, I should have investigated the code more carefully. Attached patch win32_bytes_filename.patch tries to solve both

[issue15441] test_posixpath fails on Japanese edition of Windows

2012-07-26 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: I still would prefer if only one issue at a time gets fixed, in particular if the two issues require independent changes. This issue is about test_nonascii_abspath failing on the Japanese edition of Windows (see the first sentence of the

[issue15441] test_posixpath fails on Japanese edition of Windows

2012-07-25 Thread STINNER Victor
STINNER Victor victor.stin...@gmail.com added the comment: The following change is a major change on how Python handles undecodable filenames on Windows: -return PyUnicode_DecodeMBCS(s, size, NULL); +return PyUnicode_DecodeMBCS(s, size, surrogateescape); I disagree with this change,

[issue15441] test_posixpath fails on Japanese edition of Windows

2012-07-25 Thread STINNER Victor
STINNER Victor victor.stin...@gmail.com added the comment: If a file name was invalid byte character, os.chdir() raises UnicodeDecodeError() instead of WindowsError. I realized that the problem is in the error handling: raising the OSError fails with a UnicodeDecodeError because

[issue15441] test_posixpath fails on Japanese edition of Windows

2012-07-25 Thread Atsuo Ishimoto
Atsuo Ishimoto ishim...@gembook.org added the comment: Yes, I know #13374, that's why I wrote This is a byte-api issue on Windows, so we may be able to simply skip this test. Do you think we need a patch to avoid UnicodeDecodeError raised? Or should we change test to skip this? --

[issue15441] test_posixpath fails on Japanese edition of Windows

2012-07-25 Thread STINNER Victor
STINNER Victor victor.stin...@gmail.com added the comment: Do you think we need a patch to avoid UnicodeDecodeError raised? Or should we change test to skip this? It's a bug, the test should not be skipped. You should get an OSError because the chdir() failed, not an UnicodeDecodeError.

[issue15441] test_posixpath fails on Japanese edition of Windows

2012-07-25 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: As for your patch: you are missing the point of the test. The file name is assumed to be valid, despite it not being in the file system encoding. -- ___ Python tracker rep...@bugs.python.org

[issue15441] test_posixpath fails on Japanese edition of Windows

2012-07-25 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: IMO, it is ok to skip the test on Windows; it was apparently targeted for Unix. If we preserve it, we should pick a file name (on Windows) which is encodable in the file system encoding. -- ___

[issue15441] test_posixpath fails on Japanese edition of Windows

2012-07-25 Thread STINNER Victor
STINNER Victor victor.stin...@gmail.com added the comment: decode_filename_mbcs.patch uses the replace error handler to decode the filename on Windows. It should solve the issue. -- Added file: http://bugs.python.org/file26515/decode_filename_mbcs.patch

[issue15441] test_posixpath fails on Japanese edition of Windows

2012-07-25 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: haypo: how is this meant to fix the bug? Won't it now cause a WindowsError, when a successful operation is expected? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15441

[issue15441] test_posixpath fails on Japanese edition of Windows

2012-07-25 Thread STINNER Victor
STINNER Victor victor.stin...@gmail.com added the comment: haypo: how is this meant to fix the bug? Won't it now cause a WindowsError, when a successful operation is expected? Oh, I was referring to the new test proposed in the attached patch (issue15441.patch): +def

[issue15441] test_posixpath fails on Japanese edition of Windows

2012-07-25 Thread Atsuo Ishimoto
Atsuo Ishimoto ishim...@gembook.org added the comment: Here's another try: In this patch: - skip test_nonascii_abspath() test since it fails on some code pages. - Added a test to reproduce bug on latin code pages. - Use repr(filename) only if decode failed. This is more backward-compatible

[issue15441] test_posixpath fails on Japanese edition of Windows

2012-07-25 Thread Atsuo Ishimoto
Atsuo Ishimoto ishim...@gembook.org added the comment: martin: while os.mkdir(b'\xe7w\xf0') succeeds, but strangely enough, subsequent os.chdir(b'\xe7w\xf0') fails. This is not a bug in Python, but Windows issue. -- ___ Python tracker

[issue15441] test_posixpath fails on Japanese edition of Windows

2012-07-25 Thread Atsuo Ishimoto
Atsuo Ishimoto ishim...@gembook.org added the comment: Updated patch again. In this patch, byte object is passed as argument to WindowsError as Victor's patch. I prefer to fix PyErr_SetFromWindowsErrWithFilename() over path_error(), because PyErr_SetFromWindowsErrWithFilename() is public

[issue15441] test_posixpath fails on Japanese edition of Windows

2012-07-24 Thread Atsuo Ishimoto
New submission from Atsuo Ishimoto ishim...@gembook.org: test_posixpath.PosixCommonTest.test_nonascii_abspath fails on Japanese edition of Windows. If a file name was invalid byte character, os.chdir() raises UnicodeDecodeError() instead of WindowsError. This is a byte-api issue on Windows,

[issue15441] test_posixpath fails on Japanese edition of Windows

2012-07-24 Thread Atsuo Ishimoto
Atsuo Ishimoto ishim...@gembook.org added the comment: changed name of test method. In the old patch, new test method shadowed existing one. -- Added file: http://bugs.python.org/file26502/test_nonascii_abspath_2.patch ___ Python tracker

[issue15441] test_posixpath fails on Japanese edition of Windows

2012-07-24 Thread Atsuo Ishimoto
Changes by Atsuo Ishimoto ishim...@gembook.org: Removed file: http://bugs.python.org/file26500/test_nonascii_abspath.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15441 ___

[issue15441] test_posixpath fails on Japanese edition of Windows

2012-07-24 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +haypo stage: - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15441 ___ ___

[issue15441] test_posixpath fails on Japanese edition of Windows

2012-07-24 Thread Atsuo Ishimoto
Changes by Atsuo Ishimoto ishim...@gembook.org: Removed file: http://bugs.python.org/file26502/test_nonascii_abspath_2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15441 ___

[issue15441] test_posixpath fails on Japanese edition of Windows

2012-07-24 Thread Atsuo Ishimoto
Atsuo Ishimoto ishim...@gembook.org added the comment: I'm sorry, I generated a patch in wrong direction. -- Added file: http://bugs.python.org/file26506/issue15441.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15441