Comments (4)
A slight delay... but it sounds like this is fixed in 1.0.0 @dimaqq
from python-stripzip.
Example dump with ID's:
03CB LOCAL HEADER #3 04034B50
03CF Extract Zip Spec 14 '2.0'
03D0 Extract OS 00 'MS-DOS'
03D1 General Purpose Flag 0000
[Bits 1-2] 0 'Normal Compression'
03D3 Compression Method 0008 'Deflated'
03D5 Last Mod Time 00210000 'Tue Jan 1 00:00:00 1980'
03D9 CRC 57570410
03DD Compressed Length 000006C1
03E1 Uncompressed Length 00001BC8
03E5 Filename Length 000F
03E7 Extra Length 001C
03E9 Filename 'somemodule/somefile.py'
03F8 Extra ID #0001 5455 'UT: Extended Timestamp'
03FA Length 0009
03FC Flags '03 mod access'
03FD Mod Time 5BE27B08 'Wed Nov 7 14:41:28 2018'
0401 Access Time 5BEBDCB6 'Wed Nov 14 17:28:38 2018'
0405 Extra ID #0002 7875 'ux: Unix Extra Type 3'
0407 Length 000B
0409 Version 01
040A UID Size 04
040B UID 000001F5
040F GID Size 04
0410 GID 00000014
0414 PAYLOAD
I guess the entire "extended timestamp" should be nuked.
I can do zip -X
for new archives, but I think stripzip would still be great for existing archives.
from python-stripzip.
Thanks @dimaqq for the heads up and dumps, I missed that as the files I was was working with with were made by zipfile in setuptools.
The core ZIP format doesn't include things like access times, ownership, or permissions. Information like that comes from additional data put into the extra field on records, where it looks like there are at least 51 types of extension. In this case, a couple of extra fields types are involved:
- 0x5455 - extended timestamp information, fields of this type can be flat out dropped
- 0x5855/0x7855/0x7875 - additional Unix information that I haven't yet found the format of, but suspect it can't be dropped (without breaking symlinks), but it could probably be zeroed
Plan of action:
- make issues on GitHub for known issues and work below
- version/system information not zeroed
- look into the the additional Unix information
- make a function which can wipe out targeted extended fields (i.e. 0x5455)
- always remove 0x5455 extra fields by default
- document things like trying to get the zip software to avoid as much cleaning work as possible:
- use constant compression ratio
- avoid extension fields where possible, e.g.
zip --no-extra …
In the mean time, it seems like rezipping with the --no-extra
flag is as good as it gets without using an alternative tool. I'll try to get some time to work on these issues over the next week.
from python-stripzip.
Oops, I can't operate a mouse
from python-stripzip.
Related Issues (2)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-stripzip.