New submission from Erik Bray: This is vaguely related to issue14067, though the patch suggested there would make this problem worse, not better.
This addresses a problem that cropped up on OSX in which some code that, for Good Reasons, generates a module in a package directory and then expects to be able to import it. Because HFS+ does not offer sub-second resolution for mtime the generated module is not found. We didn't have this problem on Linux or Windows. I've attached one possible solution to the issue, which uses a tuple of st_mtime and st_nlink to determine if the cache should be invalidated. This should pick up most file creation/deletion on such file systems even if the directory's mtime hasn't changed. This doesn't add any additional system calls so it shouldn't have any significant performance impact. In the meantime importlib.invalidate_caches() offers a consistent workaround, but it was surprising when this issue was found to be platform dependent. ---------- components: None hgrepos: 178 messages: 183270 nosy: erik.bray priority: normal severity: normal status: open title: Check st_nlink in addition to st_mtime to invalidate FileFinder cache type: behavior versions: Python 3.3 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue17330> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com