I have two threads, one which writes to a file, and another which periodically
moves the file to a different location. The writes always calls open before writi
When two threads access the same resources, weird things happen. To avoid that, always lock the resource. Python has the convenient threading.Lock for that, as well as some other tools (see documentation of the threading module).