From 7c74de4d00dc29143302bd2f718b3e3b04dafe9b Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Thu, 10 Oct 2013 15:55:14 +0200 Subject: 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. --- Objects/codeobject.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Objects/codeobject.c b/Objects/codeobject.c index 9713f61..353f414 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); -- cgit v0.12