Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 15a71cd

Browse files
author
Victor Stinner
committed
PyErr_SyntaxLocationEx() uses PyUnicode_DecodeFSDefault(), instead of
PyUnicode_FromString(), to decode the filename.
1 parent 5b5d8d5 commit 15a71cd

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Python/errors.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -819,7 +819,7 @@ PyErr_SyntaxLocationEx(const char *filename, int lineno, int col_offset)
819819
}
820820
}
821821
if (filename != NULL) {
822-
tmp = PyUnicode_FromString(filename);
822+
tmp = PyUnicode_DecodeFSDefault(filename);
823823
if (tmp == NULL)
824824
PyErr_Clear();
825825
else {

0 commit comments

Comments
 (0)