Philip Jenvey avatar Philip Jenvey committed 7ea913f

assert_str0 stat paths

Comments (0)

Files changed (1)

pypy/module/imp/importing.py

 from pypy.interpreter.eval import Code
 from pypy.interpreter.pycode import PyCode
 from pypy.rlib import streamio, jit
+from pypy.rlib.rstring import assert_str0
 from pypy.rlib.streamio import StreamErrors
 from pypy.rlib.objectmodel import we_are_translated, specialize
 from pypy.module.sys.version import PYPY_VERSION
     if py is None:
         py = filename[:-1]
     try:
-        st = os.stat(py)
+        st = os.stat(assert_str0(py))
     except OSError:
         pass
     else:
 
     if space.config.objspace.usepycfiles:
         cpathname = make_compiled_pathname(pathname)
-        src_stat = os.stat(pathname)
+        src_stat = os.stat(assert_str0(pathname))
         mtime = int(src_stat[stat.ST_MTIME])
         mode = src_stat[stat.ST_MODE]
         stream = check_compiled_module(space, cpathname, mtime)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.