I'm facing a strange issue using the standard open(path, "w")
function to write to a file.
It works as expected on my mac, but I tried my script on VM running Windows 7 and I get "[Errno 17] File exists" exception... this is driving me crazy since I really don't understand... I perfectly know that the file exists, and in fact is my intention open it and write content into it... can you explain me where the problem may comes from?
ps. I also checked that I have the permission to write to the file using os.access(path, os.W_OK)
uh... on my Mac I'm using Python 2.7 and 3.3 on the VM... but the official docs don't report any significant change in the function :P
UPDATE:
After refactoring my code in order to remove threads (since I thought they may be the problem), I get a "permission denied error"... the file is not used by any other process since I have simulated that scenario by getting a "permissionError: the process cannot access the file because it is being used by another process".
My python program is running as a pydev build in Eclipse... if I open a shell and I run the command f = open(thefile, "w")
no error occurs. The Eclipse workspace is located under user documents... so I have the necessary rights... what should be? I'm really stuck :( (on my mac os x all works perfectly even after switching to python 3.3 and code refactoring)