This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2012年06月03日 19:16 by gregory.p.smith, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Messages (4) | |||
|---|---|---|---|
| msg162228 - (view) | Author: Gregory P. Smith (gregory.p.smith) * (Python committer) | Date: 2012年06月03日 19:16 | |
====================================================================== ERROR: test_exist_ok_existing_directory (__main__.MakedirTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "Lib/test/test_os.py", line 842, in test_exist_ok_existing_directory os.makedirs(path, mode=mode, exist_ok=True) File "/home/greg/sandbox/python/cpython/default/Lib/os.py", line 161, in makedirs mkdir(name, mode) FileExistsError: [Errno 17] File exists (mode 0o2755 != desired mode 0o755): '@test_4027_tmp/dir1' (I modified os.makedirs to add the info on the mode differences above to highlight the source of the problem) 0o2000 is the S_ISGID bit on a directory which is a "contagious" bit that is automatically copied onto subdirectories. os.makedirs is not expecting to find it so exist_ok does not work as desired. Workaround: Don't run the Python test suite from a directory with that bit set. I think the os.makedirs() behavior should be to ignore bits that can appear regardless of the umask as it makes exist_ok=True useless in that situation. |
|||
| msg162234 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2012年06月03日 21:36 | |
New changeset fef529f3de5b by Gregory P. Smith in branch '3.2': Fixes Issue #14992: os.makedirs(path, exist_ok=True) would raise an OSError http://hg.python.org/cpython/rev/fef529f3de5b New changeset eed26e508b7e by Gregory P. Smith in branch 'default': Fixes Issue #14992: os.makedirs(path, exist_ok=True) would raise an OSError http://hg.python.org/cpython/rev/eed26e508b7e |
|||
| msg162969 - (view) | Author: R. David Murray (r.david.murray) * (Python committer) | Date: 2012年06月16日 13:49 | |
See also issue 13498. |
|||
| msg167758 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2012年08月09日 04:03 | |
New changeset 3f42c9dbd8a7 by Ned Deily in branch '3.2': Issue #14992: Prevent test_os test_exist_ok_s_isgid_directory test case http://hg.python.org/cpython/rev/3f42c9dbd8a7 New changeset a1c8c79e035d by Ned Deily in branch 'default': Issue #14992: merge from 3.2 http://hg.python.org/cpython/rev/a1c8c79e035d |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:31 | admin | set | github: 59197 |
| 2012年08月09日 04:03:48 | python-dev | set | messages: + msg167758 |
| 2012年06月16日 13:49:59 | r.david.murray | set | nosy:
+ r.david.murray messages: + msg162969 |
| 2012年06月03日 21:42:29 | gregory.p.smith | set | status: open -> closed assignee: gregory.p.smith resolution: fixed |
| 2012年06月03日 21:36:53 | python-dev | set | nosy:
+ python-dev messages: + msg162234 |
| 2012年06月03日 20:51:05 | gregory.p.smith | set | versions: + Python 3.2 |
| 2012年06月03日 19:16:34 | gregory.p.smith | create | |