New submission from STINNER Victor <victor.stin...@haypocalc.com>:

PyErr_SetFromWindowsErrWithFilename() expects a filename encoded to UTF-8. It 
is called by win32_error() function of the nt (posix) module, and win32_error() 
is called on an error in the bytes implementation of a function (if the 
argument is a byte string, not an Unicode string). But on Windows, bytes 
filenames are encoded to the ANSI code page, not to UTF-8.

PyErr_SetExcFromWindowsErrWithFilename() expects also a filename encoded to 
UTF-8. It is not used in Python core, but I think that it should be fixed too.

See also #10779 (and #9713 and #10114).

----------
components: Interpreter Core, Unicode, Windows
messages: 124697
nosy: haypo
priority: normal
severity: normal
status: open
title: Fix filename encoding in PyErr_SetFromWindowsErrWithFilename() (and 
PyErr_SetExcFromWindowsErrWithFilename())
versions: Python 3.2

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue10780>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to