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 yorick
Recipients
Date 2005-06-25.21:11:15
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Logged In: YES 
user_id=432579

I'm fine with fixing the design for 2.5 and ignoring the bug for 2.4, since 
programs susceptible to the bug must use some kind of work-around in 
2.4.x (x < 2) anyway.
What I am using right now is:

def makedirs(name, mode=0777):
    try:
        os.mkdir(name, mode)
        return
    except OSError, err:
        if err.errno == errno.EEXIST:
            return
        if err.errno != errno.ENOENT:
            raise
    makedirs(os.path.dirname(name), mode)
    makedirs(name, mode)

This is compact and elegant, but relies on mkdir producing the correct 
errno values, which should be true for all platforms I'm aware of. It could 
also theoretically loop infinitely in bizarre cases but I don't see how that 
ever could happen.
History
Date User Action Args
2007-08-23 14:32:31adminlinkissue1223238 messages
2007-08-23 14:32:31admincreate