Change os.makedirs to handle existing directory

Tim Delaney timothy.c.delaney at
Tue Feb 14 00:18:58 CET 2012

On 14 February 2012 09:59, Wanderer <wanderer at> wrote:

> I think wanting to create a directory if one doesn't exist or do
> nothing if it does exist and just use the existing directory is a
> fairly normal programming need. Apparently this is somewhat
> complicated in Python.
> ...
> IMHO, os.makedirs should do this for you with something like
> os.makedirs(dirName, exist = False)
> and have makedirs silence the error the 'right' way whatever that is,
> without turning it into an exercise for the user.

Added in 3.2:

Tim Delaney
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Python-list mailing list