I have a problem with understanding a strange file locking behavior in Python Debugger.
I have a 2TB image file, which my script reads. Everything works perfect, until I want to read the same file with a different hex editor. If the file is opened in hex editor before I start my script, everything is fine. If I try to open the file during script paused at breakpoint, my system almost hangs and becomes very slow. I normally can kill Pyhon and hex editor from terminal, but it is very slow and takes up to 10 minutes.
The same problem apperares AFTER I stop the script and even extensively kill all Python instances. The disk, where this image is situated is remained locked and it's not possible to unmount it (only with diskutil force command), system hangs if I try to open the file anywhere else.
Also I can't start scripts one after another, next scripts just stops working and hangs my system.
I have to wait up to 10 minutes to be able to work with the file again.
I tried to find the process which locks the file with "sudo lsof +D" command but it doesn't list anything.
Here are some more details: — My system is Mac Os X 10.9. Python is 3.4. I use Eclipse with Pydev to develop the script. — I use open('image.dmg', mode='rb') command to open the file in python and close()to close it. — The file is a 2TB disk image on external ExFat formatted drive. Other files don't have such problems. File is write-protected in Finder settings.
Can anyone direct me in a proper direction to locate the source of this problem?