Fix error wrapping stdout when redirecting
authorChristian Herdtweck <christian.herdtweck@intra2net.com>
Thu, 24 May 2018 10:29:49 +0000 (12:29 +0200)
committerChristian Herdtweck <christian.herdtweck@intra2net.com>
Mon, 8 Oct 2018 07:37:41 +0000 (09:37 +0200)
commit667e02f48d1f633f3213143d76bbf593198e8102
tree36ca7d09a40c62ec0f3cf2080d239e74eeae904b
parente33dd338c519248d2b2d018e3e5a06837905d59b
Fix error wrapping stdout when redirecting

In some cases (e.g. redirecting stdout to shell), the automatic determination
in ZipFile constructor whether its file argument can seek() and tell() fails.
stdout seems to support both but returns bogus values for tell(), resulting
in negative sizes when writing the archive's end record.

Provide a fix with additional arg force_wrap

Also ensure that CRCs are always correct as suggested in python docs and
stackoverflow
src/zip_stream.py