• Gregory P. Smith's avatar
    Fixes issue19081: When a zipimport .zip file in sys.path being imported · b48c5d51
    Gregory P. Smith authored
    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.
    b48c5d51
zipimport.c 43.8 KB