]> granicus.if.org Git - python/commitdiff
When /tmp has certain sticky bits set, newly created subdirectories
authorGuido van Rossum <guido@python.org>
Wed, 31 Mar 2004 18:53:29 +0000 (18:53 +0000)
committerGuido van Rossum <guido@python.org>
Wed, 31 Mar 2004 18:53:29 +0000 (18:53 +0000)
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 d014ee83acf0f24ca8b6ff2d9523ce55dce0202b..83e2174f994e08753651b053c4b14340e86b0d01 100644 (file)
@@ -479,6 +479,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';