python / python/cpython

`zipfile`: docs should document what `ZipInfo.date_time` actually is

Offen
#133,125 5 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

3.13 3.14 docs stdlib
Vorherrschende Sprache
Python
Sterne
77.2k
Forks
35.9k
PR-Merge-Kennzahlen
PR-Kennzahlen ausstehend

Beschreibung

Documentation

Currently, the documentation for ZipInfo.date_time is:

The time and date of the last modification to the archive member. This is a tuple of six values:
...
Note: The ZIP file format does not support timestamps before 1980.

This should be extended/clarified to define which date/time is meant (which currently is only hinted by the does not support timestamps before 1980.

The ZIP format supports for multiple timestamps:

  • there's the last mod file time and last mod file date in the central directory (see chapters 4.3.7 and 4.4.6)
  • but also various times (e.g. for NTFS and UNIX) as part of the extra fields (see e.g. chapter 4.5.7).

The latter may e.g. support times before 1980, higher resolutions and time zones.

Right now it seems not strictly defined what .date_time actually returns - from what I can see from the code, it's the one from the central directory - but that could in principle be just an implementation detail and a future version of zipfile could e.g. use the extra fields if present.

Thus it would be nice, if the documentation could specify, whether .date_time is always meant to be the time from the central directory, or whether this could change.

Thanks,
Chris.

Linked PRs
  • gh-136082
  • gh-138076
  • gh-138077

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginnen Sie mit der verlinkten zipfile.ZipInfo.date_time-Dokumentation und untersuchen Sie die bestehende zipfile-Implementierung, die dieses Attribut bereitstellt. Aktualisieren Sie die Dokumentation so, dass angegeben wird, welchen ZIP-Zeitstempel es repräsentiert und wie dieser mit anderen Zeitstempelfeldern zusammenhängt. Überprüfen Sie anschließend den gerenderten Wortlaut und die Dokumentationsprüfungen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
documentation
Issue-Typ
Dokumentation
Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.