This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: py3k: Unicode error in os.stat on Windows
Type: Stage:
Components: Versions:
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 2022-04-11 14:56 by admin. This issue is now closed.

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.
Date User Action Args
2022-04-11 14:56:26adminsetgithub: 45416
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