Author: Matti Picus <[email protected]>
Branch: py3.6
Changeset: r96720:95ef57b94c9d
Date: 2019-05-31 00:09 +0300
http://bitbucket.org/pypy/pypy/changeset/95ef57b94c9d/
Log: fixes for win32
diff --git a/pypy/module/posix/interp_posix.py
b/pypy/module/posix/interp_posix.py
--- a/pypy/module/posix/interp_posix.py
+++ b/pypy/module/posix/interp_posix.py
@@ -2277,7 +2277,7 @@
space.newint(info[2])])
def _getfinalpathname(space, w_path):
- path = space.utf8_w(w_path)
+ path = space.utf8_w(w_path).decode('utf-8')
try:
result = nt._getfinalpathname(path)
except nt.LLNotImplemented as e:
diff --git a/pypy/module/posix/test/test_posix2.py
b/pypy/module/posix/test/test_posix2.py
--- a/pypy/module/posix/test/test_posix2.py
+++ b/pypy/module/posix/test/test_posix2.py
@@ -10,7 +10,6 @@
from pypy.interpreter.gateway import interp2app
from rpython.translator.c.test.test_extfunc import need_sparse_files
from rpython.rlib import rposix
-from rpython.rlib.objectmodel import we_are_translated
USEMODULES = ['binascii', 'posix', 'signal', 'struct', 'time']
# py3k os.open uses subprocess, requiring the following per platform
@@ -319,7 +318,7 @@
ex(self.posix.write, UNUSEDFD, b"x")
ex(self.posix.close, UNUSEDFD)
#UMPF cpython raises IOError ex(self.posix.ftruncate, UNUSEDFD, 123)
- if sys.platform == 'win32' and not we_are_translated():
+ if sys.platform == 'win32' and self.runappdirect:
# XXX kills the host interpreter untranslated
ex(self.posix.fstat, UNUSEDFD)
ex(self.posix.stat, "qweqwehello")
@@ -1082,7 +1081,7 @@
os.closerange(start, stop)
for fd in fds:
os.close(fd) # should not have been closed
- if self.platform == 'win32' and not we_are_translated():
+ if self.platform == 'win32' and self.runappdirect:
# XXX kills the host interpreter untranslated
for fd in range(start, stop):
raises(OSError, os.fstat, fd) # should have been closed
diff --git a/pypy/module/posix/test/test_scandir.py
b/pypy/module/posix/test/test_scandir.py
--- a/pypy/module/posix/test/test_scandir.py
+++ b/pypy/module/posix/test/test_scandir.py
@@ -189,7 +189,7 @@
def test_fspath(self):
posix = self.posix
d = next(posix.scandir(self.dir1))
- assert self.posix.fspath(d).endswith('dir1/file1')
+ assert self.posix.fspath(d).endswith('dir1' + self.sep + 'file1')
def test_resource_warning(self):
posix = self.posix
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit