I am not certain but I think it is worth checking if your MODIFY notification is happening on your config file or on another file.
Many editors write changes to a file by first writing a temporary file. For example, if your file was named config.txt
it might be written by writing .config.txt.new#1234
and then rename .config.txt.new#1234
to config.txt
Since inotify is on a directory it might be seeing the creation and modification of the temporary file, trigger a notification and your program reads the configuration before it can be replaced by the new file.
Another possible problem is that MODIFY event happens as soon as write() is called on the file. If the file is being written in several write calls, your program might open and read the configuration file before it is completely written. From your example, the configuration dictionary might contain the old values if they were not overwritten by a new value.
Instead of the MODIFY event, try using CLOSE_WRITE instead.