`mtime` property throws exception writable `GzipFile` instances

Offen
#160,860 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
35/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Veraltet
Tech-Stack
python
Bereich
backend

Rechercherichtung

Start by reading the writable GzipFile initialization and the mtime property in the gzip module, then check the tests for writable gzip streams. The report says gzip.open(io.BytesIO(), mtime=1234567) returns None for mtime; done means the reported value reflects the constructor argument and the relevant test covers it.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

stdlib type-bug
Bug report
>>> g = gzip.open(io.BytesIO(), "wb", mtime=1234567)
>>> g.mtime
AttributeError: '_WriteBufferStream' object has no attribute '_last_mtime'

Instead of an exception, I believe it should reflect the value passed to the constructor.

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

Linked PRs
  • gh-160861
Vorherrschende Sprache
Python
Sterne
77.8k
Forks
37.7k
Ø Merge
17 Std. 24 Min.
Gemergte PRs (30 T.)
716

Entwicklungsumgebung

In Codespaces öffnen

Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus python/cpython

Alle Issues in python/cpython

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

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