[pypy-commit] pypy default: Avoid calling mkdir() with 0 as the initial mode argument. The tests

arigo pypy.commits at gmail.com
Fri May 27 08:21:58 EDT 2016


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r84726:fcfb3174ef7e
Date: 2016-05-27 14:22 +0200
http://bitbucket.org/pypy/pypy/changeset/fcfb3174ef7e/

Log:	Avoid calling mkdir() with 0 as the initial mode argument. The tests
	pass either way, but we're left with hard-to-remove stuff in /tmp.

diff --git a/rpython/rlib/test/test_rposix.py b/rpython/rlib/test/test_rposix.py
--- a/rpython/rlib/test/test_rposix.py
+++ b/rpython/rlib/test/test_rposix.py
@@ -99,9 +99,9 @@
 
     def test_mkdir(self):
         filename = str(udir.join('test_mkdir.dir'))
-        rposix.mkdir(filename, 0)
+        rposix.mkdir(filename, 0777)
         with py.test.raises(OSError) as excinfo:
-            rposix.mkdir(filename, 0)
+            rposix.mkdir(filename, 0777)
         assert excinfo.value.errno == errno.EEXIST
         if sys.platform == 'win32':
             assert excinfo.type is WindowsError
@@ -112,9 +112,9 @@
         filename = str(udir.join(relpath))
         dirfd = os.open(os.path.dirname(filename), os.O_RDONLY)
         try:
-            rposix.mkdirat(relpath, 0, dir_fd=dirfd)
+            rposix.mkdirat(relpath, 0777, dir_fd=dirfd)
             with py.test.raises(OSError) as excinfo:
-                rposix.mkdirat(relpath, 0, dir_fd=dirfd)
+                rposix.mkdirat(relpath, 0777, dir_fd=dirfd)
             assert excinfo.value.errno == errno.EEXIST
         finally:
             os.close(dirfd)


More information about the pypy-commit mailing list