[Python-checkins] r70158 - in python/branches/release30-maint: Python/import.c
hirokazu.yamamoto
python-checkins at python.org
Wed Mar 4 02:58:09 CET 2009
Author: hirokazu.yamamoto
Date: Wed Mar 4 02:58:09 2009
New Revision: 70158
Log:
Merged revisions 70157 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r70157 | hirokazu.yamamoto | 2009-03-04 10:52:10 +0900 | 1 line
Issue #5273: Fixed import failure on unicode path. (especially on windows)
........
Modified:
python/branches/release30-maint/ (props changed)
python/branches/release30-maint/Python/import.c
Modified: python/branches/release30-maint/Python/import.c
==============================================================================
--- python/branches/release30-maint/Python/import.c (original)
+++ python/branches/release30-maint/Python/import.c Wed Mar 4 02:58:09 2009
@@ -988,13 +988,15 @@
{
PyObject *oldname, *newname;
- if (!PyUnicode_CompareWithASCIIString(co->co_filename, pathname))
- return 0;
-
- newname = PyUnicode_FromString(pathname);
+ newname = PyUnicode_DecodeFSDefault(pathname);
if (newname == NULL)
return -1;
+ if (!PyUnicode_Compare(co->co_filename, newname)) {
+ Py_DECREF(newname);
+ return 0;
+ }
+
oldname = co->co_filename;
Py_INCREF(oldname);
update_code_filenames(co, oldname, newname);
More information about the Python-checkins
mailing list