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.

Author ysj.ray
Recipients ysj.ray
Date 2010-07-19.08:47:31
SpamBayes Score 0.0031152463
Marked as misclassified No
Message-id <1279529255.89.0.917982060428.issue9299@psf.upfronthosting.co.za>
In-reply-to
Content
As discussed in python-dev mailing list, something should be add to os.mkdir() and os.makedirs() to simulate the shell's "mkdir -p" function, that is, suppress the OSError exception if the target directory exists. 

Here is a patch against py3k, with code, test and doc. I add an "ensure_exist" keyword argument for both os.mkdir() and os.makedirs(), indicates weather an OSError is raised if the target directory already exists.

Since I've no windows environment, I only tested the patch on Unix. Hope someone could help test it on windows.
History
Date User Action Args
2010-07-19 08:47:35ysj.raysetrecipients: + ysj.ray
2010-07-19 08:47:35ysj.raysetmessageid: <1279529255.89.0.917982060428.issue9299@psf.upfronthosting.co.za>
2010-07-19 08:47:33ysj.raylinkissue9299 messages
2010-07-19 08:47:33ysj.raycreate