summaryrefslogtreecommitdiff
path: root/Python/errors.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2010-12-28 00:28:21 +0000
committerVictor Stinner <victor.stinner@haypocalc.com>2010-12-28 00:28:21 +0000
commitbc8d3f58c0217b4babbb9ff8d401901d1f15a7f3 (patch)
treeefcb8b5149b42770c4b60efd65a7f88dc316cd82 /Python/errors.c
parent38f2a562985bb4d7290896fd46b3380522f60329 (diff)
downloadcpython-bc8d3f58c0217b4babbb9ff8d401901d1f15a7f3.tar.gz
Issue #10780: PyErr_SetFromWindowsErrWithFilename() and
PyErr_SetExcFromWindowsErrWithFilename() decode the filename from the filesystem encoding instead of UTF-8.
Diffstat (limited to 'Python/errors.c')
-rw-r--r--Python/errors.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Python/errors.c b/Python/errors.c
index d5a6fae0b4..5a9a624279 100644
--- a/Python/errors.c
+++ b/Python/errors.c
@@ -515,7 +515,7 @@ PyObject *PyErr_SetExcFromWindowsErrWithFilename(
int ierr,
const char *filename)
{
- PyObject *name = filename ? PyUnicode_FromString(filename) : NULL;
+ PyObject *name = filename ? PyUnicode_DecodeFSDefault(filename) : NULL;
PyObject *ret = PyErr_SetExcFromWindowsErrWithFilenameObject(exc,
ierr,
name);
@@ -552,7 +552,7 @@ PyObject *PyErr_SetFromWindowsErrWithFilename(
int ierr,
const char *filename)
{
- PyObject *name = filename ? PyUnicode_FromString(filename) : NULL;
+ PyObject *name = filename ? PyUnicode_DecodeFSDefault(filename) : NULL;
PyObject *result = PyErr_SetExcFromWindowsErrWithFilenameObject(
PyExc_WindowsError,
ierr, name);