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 jimjjewett
Recipients
Date 2005-12-02.20:11:17
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Logged In: YES 
user_id=764593

slight misdiagnosis on my part -- it only fails if the 
*entire* directory tree already exists.  
 
"""
>>> os.makedirs('c:/temp/a/b/c')

>>> os.makedirs('c:/temp/a/b/c')

Traceback (most recent call last):
  File "<pyshell#64>", line 1, in -toplevel-
    os.makedirs('c:/temp/a/b/c')
  File "C:\Python24\lib\orig_os.py", line 159, in makedirs
    mkdir(name, mode)
OSError: [Errno 17] File exists: 'c:/temp/a/b/c'
"""

My use case was generating java files in the proper package 
- and possibly regenerating them if something changed.  I 
want to put them in the right directory, which will usually 
(but not always) already exist.

The patch still works, but I now wonder if it might be 
better to put a guard at the top along the lines of "if 
path.exists(name): return" (or something fancier to ensure 
that it is a directory with appropriate permissions).
History
Date User Action Args
2007-08-23 15:44:09adminlinkissue1314067 messages
2007-08-23 15:44:09admincreate