I had a strange problem 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 a virtual machine running Windows 7 and I get a "[Errno 17]. File exists" exception ... it drives me crazy since I really I donβt understand ... I know perfectly well that the file exists, and in fact it is my intention to open it and write the content to it ... Can you explain to me where the problem may occur?
ps. I also checked that I have permission to write to the file using os.access(path, os.W_OK)
uh ... on my Mac I use Python 2.7 and 3.3 on a virtual machine ... but white papers do not report a significant change in function: P
UPDATE: After refactoring my code to remove threads (since I thought it might be a problem), I get a β permission denied β ... the file is not used by any other process, since I have simulated this script, getting " permissionError: the process cannot access the file because it is being used by another process ." My python program works like building pydev in Eclipse ... if I open the shell and I run the f = open(thefile, "w") , an error does not occur. The Eclipse workspace is under user documents ... so I have the necessary permissions ... what should be? I really got stuck :( (on my mac os x everything works fine even after switching to python 3.3 and refactoring the code)
source share