[pypy-commit] pypy py3.6: merge

cfbolz pypy.commits at gmail.com
Tue Feb 26 13:02:05 EST 2019


Author: Carl Friedrich Bolz-Tereick <cfbolz at gmx.de>
Branch: py3.6
Changeset: r96177:ec74b34bb0fb
Date: 2019-02-26 19:01 +0100
http://bitbucket.org/pypy/pypy/changeset/ec74b34bb0fb/

Log:	merge

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,6 +10,7 @@
 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
@@ -291,6 +292,7 @@
                 assert 0
 
     def test_functions_raise_error(self):
+        import sys
         def ex(func, *args):
             try:
                 func(*args)
@@ -308,10 +310,12 @@
         ex(self.posix.write, UNUSEDFD, b"x")
         ex(self.posix.close, UNUSEDFD)
         #UMPF cpython raises IOError ex(self.posix.ftruncate, UNUSEDFD, 123)
-        ex(self.posix.fstat, UNUSEDFD)
-        ex(self.posix.stat, "qweqwehello")
-        # how can getcwd() raise?
-        ex(self.posix.dup, UNUSEDFD)
+        if sys.platform == 'win32' and not we_are_translated():
+            # XXX kills the host interpreter untranslated
+            ex(self.posix.fstat, UNUSEDFD)
+            ex(self.posix.stat, "qweqwehello")
+            # how can getcwd() raise?
+            ex(self.posix.dup, UNUSEDFD)
 
     def test_getcwd(self):
         os, posix = self.os, self.posix
@@ -594,7 +598,6 @@
         # using startfile in app_startfile creates global state
         test_popen.dont_track_allocations = True
         test_popen_with.dont_track_allocations = True
-        test_popen_child_fds.dont_track_allocations = True
 
     if hasattr(__import__(os.name), '_getfullpathname'):
         def test__getfullpathname(self):
@@ -1073,8 +1076,10 @@
         os.closerange(start, stop)
         for fd in fds:
             os.close(fd)     # should not have been closed
-        for fd in range(start, stop):
-            raises(OSError, os.fstat, fd)   # should have been closed
+        if sys.platform == 'win32' and not we_are_translated():
+            # XXX kills the host interpreter untranslated
+            for fd in range(start, stop):
+                raises(OSError, os.fstat, fd)   # should have been closed
 
     if hasattr(os, 'chown'):
         def test_chown(self):
@@ -1455,6 +1460,11 @@
         fname = self.path2 + 'rename.txt'
         with open(fname, "w") as f:
             f.write("this is a rename test")
+        str_name = str(self.pdir) + '/test_rename.txt'
+        os.rename(self.path, str_name)
+        with open(str_name) as f:
+            assert f.read() == 'this is a rename test'
+        os.rename(str_name, fname)
         unicode_name = str(self.udir) + u'/test\u03be.txt'
         os.rename(fname, unicode_name)
         with open(unicode_name) as f:
diff --git a/rpython/rlib/rposix.py b/rpython/rlib/rposix.py
--- a/rpython/rlib/rposix.py
+++ b/rpython/rlib/rposix.py
@@ -109,9 +109,6 @@
             wchar_t const* file,
             unsigned int line,
             uintptr_t pReserved) {
-                wprintf(L"Invalid parameter detected in function %s."
-                            L" File: %s Line: %d\\n", function, file, line);
-                wprintf(L"Expression: %s\\n", expression);
         }
 
         RPY_EXTERN void* enter_suppress_iph(void)


More information about the pypy-commit mailing list