I have a program that - on startup - checks to see if the user-supplied output directory exists. If the directory can not be found the program attempts to create it:
if not os.path.exists(path):
os.makedirs(path)
Path is a standard absolute path to a directory such as '/mnt/share/path/to/output'
It works about 75% of the time. The rest of the time I get either "exception.OSError," or "exception.IOError: [Errno 2] No such file or directory." Both exceptions have the same error number and text.
Why is this happening? I don't see how it would be permissions related or anything like that - I am writing as myself to directories I own and control - and again it works the other 3 out of 4 times. I am writing the same directory to the same place every time and deleting it recursively between program invocations for testing. It is writing to a remote share (NFS) if that matters at all.