[Python-Dev] Request for Pronouncement: PEP 441 - Improving Python ZIP Application Support

Paul Moore p.f.moore at gmail.com
Mon Feb 23 20:24:10 CET 2015


On 23 February 2015 at 19:01, Daniel Holth <dholth at gmail.com> wrote:
> Sounds reasonable. It could be done by just reading the entire file
> contents after the shebang and re-writing them with the necessary
> offset all in RAM, truncating the file if necessary, without involving
> the zipfile module very much; the shebang could have some amount of
> padding by default; the file could just be re-compressed in memory
> depending on your appetite for complexity.

The biggest problem with that is finding the end of the prefix data.
Frankly it's easier just to write a new prefix then use the zipfile
module to rewrite all of the content. That's what the current code
does writing to a new file.

Paul


More information about the Python-Dev mailing list