Agree. Through searching for existing issues, I found there isn't any such request. And I will submit one.
The '-p' option of shell's mkdir has tow functions: 1, create parents directories if not exists, 2, suppress "File exists" error if the target has already exists. What we need is the second function. So I think both os.mkdir() and os.makedirs() should add a keyword argument to suppress the "OSError: [Errno 17] File exists". So we can remove many "try...except..." codes surround os.mkdir() and os.makedirs() as Greg said, "The operation of 'make sure this directory and all its parents exist' is very commonly required" -- Ray Allen Best wishes!
_______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com