A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2010-July/102135.html below:

[Python-Dev] mkdir -p in python

[Python-Dev] mkdir -p in python [Python-Dev] mkdir -p in pythonGreg Ewing greg.ewing at canterbury.ac.nz
Wed Jul 21 02:37:20 CEST 2010
Steven D'Aprano wrote:
> Perhaps all we need is a recipe in the docs:
> 
> try:
>     os.makedirs(path)
> except OSError, e:
>     if e.errno != 17:
>         raise

I don't like writing code that depends on particular
errno values, because I don't trust it to work cross-
platform.

Also it seems suboptimal to require people to use a
recipe like this to get the behaviour that is wanted
in the overwhelming majority of cases.

I don't see what would be so bad about adding a new
function for this. Think of it as correcting the mistake
of not making makedirs() behave this way from the
beginning.

-- 
Greg
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4