OK, I've changed cache.py so that it uses stat() then open() the file if it needs to be reloaded. I've also added a unit test that makes sure the module cache is behaving as expected.
Graham, I don't think the stat() / open() / fstat() sequence is required. How would that improve accuracy ? Regards, Nicolas