From: Victor Stinner Date: Thu, 10 Oct 2013 13:55:14 +0000 (+0200) Subject: Issue #18874: PyCode_New() now ensures that the filename is a ready Unicode X-Git-Tag: v3.4.0a4~191 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7c74de4d00dc29143302bd2f718b3e3b04dafe9b;p=thirdparty%2FPython%2Fcpython.git Issue #18874: PyCode_New() now ensures that the filename is a ready Unicode string. This change does nothing is most cases, but it is useful on Windows in some cases. --- diff --git a/Objects/codeobject.c b/Objects/codeobject.c index 9713f61b244a..353f414a3848 100644 --- a/Objects/codeobject.c +++ b/Objects/codeobject.c @@ -74,6 +74,11 @@ PyCode_New(int argcount, int kwonlyargcount, PyErr_BadInternalCall(); return NULL; } + + /* Ensure that the filename is a ready Unicode string */ + if (PyUnicode_READY(filename) < 0) + return NULL; + n_cellvars = PyTuple_GET_SIZE(cellvars); intern_strings(names); intern_strings(varnames);