Fixes issue19081: When a zipimport .zip file in sys.path being imported
from is modified during the lifetime of the Python process after zipimport has already opened and cached the zip's table of contents it now fstat's the file after opening it upon every attempt to access anything within and will re-read the table of contents if the .zip file inode, size or mtime have changed. It would've been nicer to hold any .zip file used by zipimport open for the duration of the process but that would be more invasive and add an additional open file descriptor to all zipimport using processes. It also would likely not fix the problem on Windows due to different filesystem semantics.
Showing
This diff is collapsed.
Please register or sign in to comment