If I open and read the file which is periodically written, can I/O deadlock occur?
Quick advice, make sure (like, super sure) that you do close your file.
So ALWAYS use a try-except-final block for this
Remember that the contens of a final block will ALWAYS be executed, that will prevent you a lot of head pain :)
In my server process, it looks like this:
Main backend processes:

Processes Huge list of files and , record them inside MySQL.
On every 500 files done, it writes "Progress Report" to a separate file /var/run/progress.log like this "200/5000 files done"
It is multi-processed with 4 children, each made sure to run on a separate file.

Web server process:

Read the output of /var/run/progress.log every 10 seconds via Ajax and report to progress bar.

When processing a very large list of files (e.g. over 3 GB archive), the processes lock up after about 2 hours of processing.
I can't find what is going on. Does that mean that /var/run/progress.log caused an I/O deadlock?