code0x58 / python-stripzip Goto Github PK
View Code? Open in Web Editor NEWstrip zip timestamps for reproducible builds
License: MIT License
strip zip timestamps for reproducible builds
License: MIT License
when I run stripzip I'm getting this error.
Traceback (most recent call last):
File "/Users/patrickc/Library/Python/3.6/bin/stripzip", line 8, in <module>
sys.exit(cli())
File "/Users/patrickc/Library/Python/3.6/lib/python/site-packages/stripzip.py", line 123, in cli
_zero_zip_date_time(zip_)
File "/Users/patrickc/Library/Python/3.6/lib/python/site-packages/stripzip.py", line 96, in _zero_zip_date_time
purify_extra_data(mm, offset-extra_field_length-compressed_size, extra_field_length)
File "/Users/patrickc/Library/Python/3.6/lib/python/site-packages/stripzip.py", line 36, in purify_extra_data
for i in xrange(2, len(values)):
NameError: name 'xrange' is not defined
stack overflow says this is a python 2->3 compatibility issue. https://stackoverflow.com/questions/17192158/nameerror-global-name-xrange-is-not-defined-in-python-3
Thanks for writing this tool!
For me, stripzip (as installed from pypi) resets file modification time (yay!) but leaves access time, uid and gid attributes.
Here's an example from MacOS, diff between 2 runs of (zip + stripzip):
--- details.1s.txt 2018-11-14 17:29:46.000000000 +0900
+++ details.2s.txt 2018-11-14 17:30:32.000000000 +0900
@@ -15,7 +15,7 @@
0028 Length 0009
002A Flags '03 mod access'
002B Mod Time 5BE94512 'Mon Nov 12 18:17:06 2018'
-002F Access Time 5BEBDCB6 'Wed Nov 14 17:28:38 2018'
+002F Access Time 5BEBDD12 'Wed Nov 14 17:30:10 2018'
0033 Extra ID #0002 7875 'ux: Unix Extra Type 3'
0035 Length 000B
0037 Version 01
@@ -41,7 +41,7 @@
006F Length 0009
0071 Flags '03 mod access'
0072 Mod Time 5BE3EA30 'Thu Nov 8 16:48:00 2018'
-0076 Access Time 5BEBDCB6 'Wed Nov 14 17:28:38 2018'
+0076 Access Time 5BEBDD12 'Wed Nov 14 17:30:10 2018'
007A Extra ID #0002 7875 'ux: Unix Extra Type 3'
007C Length 000B
007E Version 01
Access times change because zip read the file, and uid/gid would depend on who ran zip.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.