Jason Vas Dias <jason.vas.d...@gmail.com> added the comment: oops, no sorry it was this bit from the strace log :
umask(0222) = 022 stat("./@test_9634_tmp", 0x7fff7ef64130) = -1 ENOENT (No such file or directory) open("./@test_9634_tmp.cpython-33m.so", O_RDONLY) = -1 ENOENT (No such file or directory) open("./@test_9634_tmpmodule.cpython-33m.so", O_RDONLY) = -1 ENOENT (No such file or directory) open("./@test_9634_tmp.abi3.so", O_RDONLY) = -1 ENOENT (No such file or directory) open("./@test_9634_tmpmodule.abi3.so", O_RDONLY) = -1 ENOENT (No such file or directory) open("./@test_9634_tmp.so", O_RDONLY) = -1 ENOENT (No such file or directory) open("./@test_9634_tmpmodule.so", O_RDONLY) = -1 ENOENT (No such file or directory) open("./@test_9634_tmp.py", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0644, st_size=48, ...}) = 0 open("./__pycache__/@test_9634_tmp.cpython-32.pyc", O_RDONLY) = -1 ENOENT (No such file or directory) fstat(3, {st_mode=S_IFREG|0644, st_size=48, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fd261c4a000 read(3, "# This is a test file written by test_import.py\n", 4096) = 48 read(3, "", 4096) = 0 mkdir("./__pycache__", 0100777) = 0 unlink("./__pycache__/@test_9634_tmp.cpython-32.pyc") = -1 ENOENT (No such file or directory) open("./__pycache__/@test_9634_tmp.cpython-32.pyc", O_WRONLY|O_CREAT|O_EXCL|O_TRUNC, 0100644) = 4 fcntl(4, F_GETFL) = 0x8001 (flags O_WRONLY|O_LARGEFILE) fstat(4, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fd261c49000 lseek(4, 0, SEEK_CUR) = 0 write(4, "l\f\r\n\0\0\0\0c\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\0@\0\0\0s\4\0\0\0d\0\0S(\1\0\0\0N(\0\0\0\0(\0\0\0\0(\0\0\0\0(\0\0\0\0u\23\0\0\0./@test_9634_tmp.pyu\10\0\0\0<module>\1\0\0\0s\0\0\0\0", 110) = 110 lseek(4, 4, SEEK_SET) = 4 write(4, "?\342\272M", 4) = 4 close(4) = 0 munmap(0x7fd261c49000, 4096) = 0 close(3) = 0 munmap(0x7fd261c4a000, 4096) = 0 umask(022) = 0222 stat("__pycache__", {st_mode=S_IFDIR|S_ISGID|0555, st_size=4096, ...}) = 0 stat("__pycache__/@test_9634_tmp.cpython-32.pyc", {st_mode=S_IFREG|0444, st_size=110, ...}) = 0 So the test succeeds ; ie. is correctly detecting being able to create a file in a directory with umask 0222 ; I think if you are the super-user (root) - and I am - w bits on directories owned by root are ignored - double-checking this now. So I think the fix is simply to say : if I am root user, skip this test, because it will always fail. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue11956> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com