[Answer]-Django wsgi.py change monitor detecting changes when none have been made

1👍

I’ve worked out what was causing this. The legacy file modification times are held in a dictionary as unix timestamps with decimal places (e.g. 1366283624.92) while the actual modification times are returned by os.stat(path).st_mtime as integers. All I had to do was edit the monitor script at line 54, changing:

if mtime != _times[path]:

to

if int(mtime) != int(_times[path]):

I just hope this doesn’t lead to any further problems down the road

Leave a comment