Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 59db96f

Browse files
committed
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.
1 parent 862b46b commit 59db96f

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

Lib/test/test_tempfile.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,7 @@ def test_mode(self):
479479
dir = self.do_create()
480480
try:
481481
mode = stat.S_IMODE(os.stat(dir).st_mode)
482+
mode &= 0777 # Mask off sticky bits inherited from /tmp
482483
expected = 0700
483484
if sys.platform in ('win32', 'os2emx', 'mac'):
484485
# There's no distinction among 'user', 'group' and 'world';

0 commit comments

Comments
 (0)