When I'm using vim to edit files in a django application that is running in developer mode I sometimes encounter this crash coming from the auto-reload utility:
File "/home/zefciu/.virtualenvs/15five/lib/python3.6/site-packages/django/utils/autoreload.py", line 207, in code_changed stat = os.stat(filename) FileNotFoundError: [Errno 2] No such file or directory:
What I understand is, that django is trying to check for a file that due to the way vim handles saving doesn't exist in that moment. This causes django to crash instead of reloading the application as it is meant to.
I would like to provide a patch for this crash, so in this situation, django would wait and retry the operation. I have no idea, however, what should be a sensible timeout for this? How long should I wait for the file to appear again?