]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Backport 1.17:
authorGuido van Rossum <guido@python.org>
Wed, 31 Mar 2004 18:55:17 +0000 (18:55 +0000)
committerGuido van Rossum <guido@python.org>
Wed, 31 Mar 2004 18:55:17 +0000 (18:55 +0000)
When /tmp has certain sticky bits set, newly created subdirectories
inherit those bits, causing the test_mkdtemp.test_mode() test to fail.
Remove those before comparing the actual mode to the expected mode.

Lib/test/test_tempfile.py

index 62127d8c3fb70d3ad6485be4fabb18ba75472526..270587ed4044f1baa6145c0043818779cb67cffd 100644 (file)
@@ -473,6 +473,7 @@ class test_mkdtemp(TC):
         dir = self.do_create()
         try:
             mode = stat.S_IMODE(os.stat(dir).st_mode)
+            mode &= 0777 # Mask off sticky bits inherited from /tmp
             expected = 0700
             if sys.platform in ('win32', 'os2emx', 'mac'):
                 # There's no distinction among 'user', 'group' and 'world';