diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2013-08-26 22:28:21 +0200 |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2013-08-26 22:28:21 +0200 |
commit | c36bfc1c99c6dffff8cb89c723001902d721ff97 (patch) | |
tree | aa8167d8ecf820cff004ab7ad63e11955f137777 /Modules/symtablemodule.c | |
parent | 7b89cc3b894c7eeb22c24a8df73683332509875b (diff) | |
download | cpython-c36bfc1c99c6dffff8cb89c723001902d721ff97.tar.gz |
Close #11619: The parser and the import machinery do not encode Unicode
filenames anymore on Windows.
Diffstat (limited to 'Modules/symtablemodule.c')
-rw-r--r-- | Modules/symtablemodule.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Modules/symtablemodule.c b/Modules/symtablemodule.c index fbc1ff6922..036fdb926b 100644 --- a/Modules/symtablemodule.c +++ b/Modules/symtablemodule.c @@ -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; |