I am calling os.mkdir
to create a folder with a certain set of generated data. However, even though the path I specified has not been created, the os.mkdi
Happened to me on Windows, maybe this is the case:
Like you I was trying to :
os.mkdir(dirname)
and got OSError: [Errno 17] File exists: '
.
When I ran:
os.path.exists(dirname)
I got false, and it drove me mad for a while :)
The problem was: In a certain window I was at the specific directory. Even though it did not exists at that time (I removed it from linux). The solution was to close that window \ navigate to somewhere else. Shameful, I know ...