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
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