8000 gh-133998: Fix gzip file creation when time is out of range by adang1345 · Pull Request #134278 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content
< 8000 div id="partial-discussion-header" class="gh-header mb-3 js-details-container Details js-socket-channel js-updatable-content pull request js-pull-header-details" data-channel="eyJjIjoicHVsbF9yZXF1ZXN0OjI1Mjk3MDMwNDQiLCJ0IjoxNzUxMzIyNzQ4fQ==--f371f01ee9c38967e56b028a6f80462e4cb406e282a3abdfd3a2d75b16a9f362" data-url="/python/cpython/pull/134278/partials/title?sticky=false" data-channel-event-name="title_updated" data-pull-is-open="true" data-gid="PR_kwDOBN0Z8c6WyDSE">

gh-133998: Fix gzip file creation when time is out of range #134278

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Address review comments regarding documentation
  • Loading branch information
adang1345 committed May 21, 2025
commit e701310c970ec9e723cc173f0001f34fc657e90f
8000
10 changes: 5 additions & 5 deletions Doc/library/gzip.rst
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,12 @@ The module defines the following items:
is no compression. The default is ``9``.

The optional *mtime* argument is the timestamp requested by gzip. The time
is in Unix format, i.e., seconds since *00:00:00 UTC, January 1, 1970*.
Use *mtime* = ``0`` to generate a compressed stream that does not depend on
is in Unix format, i.e., seconds since 00:00:00 UTC, January 1, 1970. Set
*mtime* to ``0`` to generate a compressed stream that does not depend on
creation time. If *mtime* is omitted or ``None``, the current time is used;
however, if the current time is outside the range
*00:00:00 UTC, January 1, 1970* through *06:28:15 UTC, February 7, 2106*,
then the value ``0`` is used instead.
however, if the current time is outside the range 00:00:00 UTC, January 1,
1970 through 06:28:15 UTC, February 7, 2106, then the value ``0`` is used
instead.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docs are slightly wrong now that GzipFile.__init__ will raise a ValueError if the specified value is out of range.
I know you've documented it in the docstring for __init__, but I think it's worth clarifying here since we're already in the area.

See below for the :attr:`mtime` attribute that is set when decompressing.

Expand Down
0