Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(164291)

Unified Diff: Modules/symtablemodule.c

Issue 11619: On Windows, don't encode filenames in the import machinery
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Modules/parsermodule.c ('k') | Parser/parsetok.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
--- a/Modules/symtablemodule.c Mon Aug 26 14:05:19 2013 +0200
+++ b/Modules/symtablemodule.c Mon Aug 26 16:10:52 2013 +0200
@@ -11,12 +11,12 @@ symtable_symtable(PyObject *self, PyObje
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, PyObje
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;
« no previous file with comments | « Modules/parsermodule.c ('k') | Parser/parsetok.c » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+