Commits

Victor Stinner committed 7731d2a

find_module_path_list() fails if _Py_fopen() failed and raised an exception
(UnicodeEncodeError).

  • Participants
  • Parent commits b87eac0

Comments (0)

Files changed (1)

File Python/import.c

             fp = _Py_fopen(filename, filemode);
             if (fp == NULL) {
                 Py_DECREF(filename);
+                if (PyErr_Occurred()) {
+                    Py_DECREF(prefix);
+                    return NULL;
+                }
                 continue;
             }
             match = case_ok(filename, -(Py_ssize_t)strlen(fdp->suffix), name);