[pypy-commit] pypy py3.5: Module names inside a zip are not fsencoded, part 2
rlamy
pypy.commits at gmail.com
Thu Nov 30 21:27:49 EST 2017
Author: Ronan Lamy <ronan.lamy at gmail.com>
Branch: py3.5
Changeset: r93229:8309e6092c02
Date: 2017-12-01 02:25 +0000
http://bitbucket.org/pypy/pypy/changeset/8309e6092c02/
Log: Module names inside a zip are not fsencoded, part 2
diff --git a/pypy/module/zipimport/interp_zipimport.py b/pypy/module/zipimport/interp_zipimport.py
--- a/pypy/module/zipimport/interp_zipimport.py
+++ b/pypy/module/zipimport/interp_zipimport.py
@@ -1,3 +1,5 @@
+import os
+import stat
from pypy.interpreter.baseobjspace import W_Root
from pypy.interpreter.error import OperationError, oefmt
@@ -9,8 +11,6 @@
from rpython.rlib.unroll import unrolling_iterable
from rpython.rlib.rzipfile import RZipFile, BadZipfile
from rpython.rlib.rzlib import RZlibError
-import os
-import stat
ZIPSEP = '/'
# note that zipfiles always use slash, but for OSes with other
@@ -145,7 +145,7 @@
return fname
def import_py_file(self, space, modname, filename, buf, pkgpath):
- w_mod = Module(space, space.newfilename(modname))
+ w_mod = Module(space, space.newtext(modname))
real_name = self.filename + os.path.sep + self.corr_zname(filename)
space.setattr(w_mod, space.newtext('__loader__'), self)
importing._prepare_module(space, w_mod, real_name, pkgpath)
More information about the pypy-commit
mailing list