This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author erik.bray
Recipients erik.bray
Date 2013-03-01.18:38:11
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1362163091.64.0.598022639655.issue17330@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2013-03-01 18:38:11erik.braysetrecipients: + erik.bray
2013-03-01 18:38:11erik.braysetmessageid: <1362163091.64.0.598022639655.issue17330@psf.upfronthosting.co.za>
2013-03-01 18:38:11erik.braylinkissue17330 messages
2013-03-01 18:38:11erik.braycreate