[Python-checkins] cpython: Issue #18874: PyCode_New() now ensures that the filename is a ready Unicode

victor.stinner python-checkins at python.org
Thu Oct 10 16:02:08 CEST 2013


http://hg.python.org/cpython/rev/bea4447c22bf
changeset:   86196:bea4447c22bf
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Thu Oct 10 15:55:14 2013 +0200
summary:
  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.

files:
  Objects/codeobject.c |  5 +++++
  1 files changed, 5 insertions(+), 0 deletions(-)


diff --git a/Objects/codeobject.c b/Objects/codeobject.c
--- a/Objects/codeobject.c
+++ b/Objects/codeobject.c
@@ -74,6 +74,11 @@
         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);

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list