shiv
shiv copied to clipboard
Incorrect bootstrap filename
When run from within a zip file (such as by directly importing the shiv wheel or within a traditional zipapp), the bootstrap files are stored with temporary file names (From src/shiv/builder.py#L160-L167):
write_to_zipapp(
archive,
str(bootstrap_target / path.name),
data,
zipinfo_datetime,
compression,
stat=path.stat(),
)
str(bootstrap_target / path.name)
won't work when embedded - path points to a temporarily extracted temporary file, producing archive names like this:
1980-01-01 06:00:00 ..... 8977 3275 _bootstrap/tmp3dxelv3u__init__.py
1980-01-01 06:00:00 ..... 2878 945 _bootstrap/tmpxt4291z2environment.py
1980-01-01 06:00:00 ..... 2063 716 _bootstrap/tmp1lkt9o0xfilelock.py
1980-01-01 06:00:00 ..... 1762 725 _bootstrap/tmprndqhn00interpreter.py
Is there some reason this isn't just str(bootstrap_target / bootstrap_file)
? Making this simple change seems to work correctly in all cases I can test. PR incoming.