[issue34097] ZIP does not support timestamps before 1980

2018-08-31 Thread STINNER Victor


STINNER Victor  added the comment:

Thanks Petr Viktorin for reporting this issue and thanks Marcel Plch for the 
fix!

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34097] ZIP does not support timestamps before 1980

2018-08-31 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 77b112cd56a50232abcdbf28f9aba88dc5d33ad3 by Victor Stinner 
(Marcel Plch) in branch 'master':
bpo-34097: Polish API design (GH-8725)
https://github.com/python/cpython/commit/77b112cd56a50232abcdbf28f9aba88dc5d33ad3


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34097] ZIP does not support timestamps before 1980

2018-08-10 Thread Marcel Plch


Change by Marcel Plch :


--
pull_requests: +8209
stage: resolved -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34097] ZIP does not support timestamps before 1980

2018-08-03 Thread STINNER Victor


STINNER Victor  added the comment:

> Tests are failed on some buildbots. See issue34325.

Marcel Plch already fixed it: commit 7b41dbad78c6b03ca2f98800a92a1977d3946643. 
The two buildbots are back to green.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34097] ZIP does not support timestamps before 1980

2018-08-02 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Tests are failed on some buildbots. See issue34325.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34097] ZIP does not support timestamps before 1980

2018-08-02 Thread Marcel Plch


Marcel Plch  added the comment:

It seems reasonable, I'll have a look at it.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34097] ZIP does not support timestamps before 1980

2018-08-02 Thread STINNER Victor


STINNER Victor  added the comment:

Serhiy:
>  If add a new option, I prefer to add it to the ZipFile constructor, 
> similarly to allowZip64. 

Aha, that would make sense. I'm not sure that it's useful to control the 
parameter per added file, it's enough to control the parameter per ZIP archive.

Marcel: would you mind to try to move the strict_timestamps parameter  from 
ZipFile.write() to ZipFile constructor?

--
resolution: fixed -> 
status: closed -> open

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34097] ZIP does not support timestamps before 1980

2018-08-02 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

If add a new option, I prefer to add it to the ZipFile constructor, similarly 
to allowZip64. Initially allowZip64 was False by default, because not all 
third-party tools supported ZIP64 extension. Later the default was changed to 
True, but you still can force raising an error if the archive is not compatible 
with old tools. I think the same policy should be applied here. Add the ability 
of writing date before 1980, and add an option for raising an error for date 
before 1980.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34097] ZIP does not support timestamps before 1980

2018-08-02 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset a2fe1e52eb94c41d9ebce1ab284180d7b1faa2a4 by Victor Stinner 
(Marcel Plch) in branch 'master':
bpo-34097: Add support for zipping files older than 1980-01-01 (GH-8270)
https://github.com/python/cpython/commit/a2fe1e52eb94c41d9ebce1ab284180d7b1faa2a4


--
nosy: +vstinner

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34097] ZIP does not support timestamps before 1980

2018-08-02 Thread STINNER Victor


STINNER Victor  added the comment:

Thank you Petr Viktorin for the bug report and thanks to Marcel Plch for the 
implementation of the new strict_timestamps keyword-only parameter!

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34097] ZIP does not support timestamps before 1980

2018-07-13 Thread Petr Viktorin


Petr Viktorin  added the comment:

Which third-party utilities support these? As I said, AFAIK `zip` on my system 
does not.

I assume the loss of data is the reason we have an error now -- if that wasn't 
a concern, zipfile could just silently bump the timestamp to 1980.

When the extensions are implemented, `strict_timestamps=False` should 
*additionally* use the extension, but default should still be to raise the 
error (to prevent metadata loss when decompressing with older/simpler tools).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34097] ZIP does not support timestamps before 1980

2018-07-13 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

You can't, because Python 2.7 doesn't support it. But you will be able to pack 
files in a ZIP archive and extract them without a loss on 3.8 and with a loss 
of a timestamp on 2.7. And you will be able to use a third-party utilities for 
extracting files without a loss.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34097] ZIP does not support timestamps before 1980

2018-07-13 Thread Petr Viktorin


Petr Viktorin  added the comment:

I'm not sure the extensions will solve this problem fully.
If an implementation that doesn't support these extensions, how does it handle 
them?

For example, if Python 3.8 implements the extensions, I use py3.8 to create a 
zipfile containing old timestamps, and then want to uncompress the file using 
Python 2.7, how do I avoid losing the timestamp information?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34097] ZIP does not support timestamps before 1980

2018-07-13 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

There are ZIP extensions which allow to save timestamps before 1980 and with 
better than 2-seconds resolution. It would be better to use this feature. But 
first we need to resolve issue17681.

--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34097] ZIP does not support timestamps before 1980

2018-07-13 Thread Marcel Plch


Marcel Plch  added the comment:

I have created a PR for this: https://github.com/python/cpython/pull/8270

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34097] ZIP does not support timestamps before 1980

2018-07-13 Thread Marcel Plch


Change by Marcel Plch :


--
keywords: +patch
pull_requests: +7805
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34097] ZIP does not support timestamps before 1980

2018-07-11 Thread Marcel Plch


Marcel Plch  added the comment:

I'm going to have a closer look at this and try to add the option.

--
nosy: +Dormouse759

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34097] ZIP does not support timestamps before 1980

2018-07-11 Thread Petr Viktorin


New submission from Petr Viktorin :

The ZIP format cannot handle times before 1980.
Issue6090 provided a nice error message for trying to add such files.

I'm seeing a system for reproducible builds that sets mtime to 1970 (zero UNIX 
timestamp), resulting in files that Python can't package into (zip-based) 
wheels.

At least here on Fedora, the `zip` command-line utility silently bumps old 
timestamps to 1980-01-01. Of course, silently corrupting data would not be good 
default behavior for Python.
But in many cases timestamps don't matter. It would be nice to give ZipFile and 
ZipFile.write() a `strict_timestamps=True` keyword argument that could be 
turned off.

--
components: Library (Lib)
messages: 321460
nosy: petr.viktorin
priority: normal
severity: normal
status: open
title: ZIP does not support timestamps before 1980
versions: Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com