Message48839
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).
|
|
Date |
User |
Action |
Args |
2007-08-23 15:44:09 | admin | link | issue1314067 messages |
2007-08-23 15:44:09 | admin | create | |
|