mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Close #11619: The parser and the import machinery do not encode Unicode
filenames anymore on Windows.
This commit is contained in:
parent
33824f6fd7
commit
14e461d5b9
22 changed files with 514 additions and 175 deletions
|
@ -11,12 +11,12 @@ symtable_symtable(PyObject *self, PyObject *args)
|
|||
PyObject *t;
|
||||
|
||||
char *str;
|
||||
char *filename;
|
||||
PyObject *filename;
|
||||
char *startstr;
|
||||
int start;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "sss:symtable", &str, &filename,
|
||||
&startstr))
|
||||
if (!PyArg_ParseTuple(args, "sO&s:symtable",
|
||||
&str, PyUnicode_FSDecoder, &filename, &startstr))
|
||||
return NULL;
|
||||
if (strcmp(startstr, "exec") == 0)
|
||||
start = Py_file_input;
|
||||
|
@ -27,9 +27,11 @@ symtable_symtable(PyObject *self, PyObject *args)
|
|||
else {
|
||||
PyErr_SetString(PyExc_ValueError,
|
||||
"symtable() arg 3 must be 'exec' or 'eval' or 'single'");
|
||||
Py_DECREF(filename);
|
||||
return NULL;
|
||||
}
|
||||
st = Py_SymtableString(str, filename, start);
|
||||
st = Py_SymtableStringObject(str, filename, start);
|
||||
Py_DECREF(filename);
|
||||
if (st == NULL)
|
||||
return NULL;
|
||||
t = st->st_blocks;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue