classification
Title: py3k: Unicode error in os.stat on Windows
Type: Stage:
Components: Versions:
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: Nosy List: amaury.forgeotdarc, loewis
Priority: normal Keywords: patch

Created on 2007-08-31 21:18 by amaury.forgeotdarc, last changed 2007-09-03 07:42 by loewis. This issue is now closed.

Files
File name Uploaded Description Edit
errors.diff amaury.forgeotdarc, 2007-08-31 21:18
Messages (2)
msg55539 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2007-08-31 21:18
os.stat("nonexistent") raises a UnicodeDecodeError on German, Polish and
French Windowses.
The reason: Windows returns an error message which contains accented
letters encoded as MBCS, but python decodes it with utf-8.
This patch uses the Unicode version of FormatMessageW to get the unicode
string directly.
msg55612 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2007-09-03 07:42
I could not quite reproduce this on the German version (the error text
reads " Das System kann die angegebene Datei nicht finden" on XP),
however, the patch looks good and it fixes the same problem for the
registry functions (where I get "Das Handle ist ungültig"), so I
committed it as r57927.
History
Date User Action Args
2007-09-03 07:42:28loewissetstatus: open -> closed
resolution: accepted
messages: + msg55612
nosy: + loewis
2007-09-02 20:11:48loewissetkeywords: + patch
2007-08-31 21:18:21amaury.forgeotdarccreate