Change os.makedirs to handle existing directory
Andrew Berg
bahamutzero8825 at gmail.com
Mon Feb 13 18:19:21 EST 2012
On 2/13/2012 4:59 PM, Wanderer 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.
There are new exceptions in 3.3, one of which is for exactly this.
http://docs.python.org/dev/whatsnew/3.3.html#pep-3151-reworking-the-os-and-io-exception-hierarchy
http://docs.python.org/dev/library/exceptions.html#FileExistsError
--
CPython 3.2.2 | Windows NT 6.1.7601.17640
More information about the Python-list
mailing list