-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
Remove time.accept2dyear #56139
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
Comments
As implemented in bpo-10827, use of 2-digits years in timetuples to mean 4-digit years straddling year 2000 is deprecated in 3.3. There is no mechanism for issuing deprecation warning for access to a module variable, but a deprecation note was added to its documentation. Attached patch removes time.accept2dyear and the associated behaviors. |
time.rst:
.. class:: struct_time (...) A year value will be handled as described under :ref:`Year 2000 (Y2K) issues <time-y2kissues>` above. .. [#] The use of ``%Z`` is now deprecated, but the ``%z`` escape that expands to the Are these 3 notes still valid? It looks like struct_time note is wrong: the year 70 is now 70 and not interpreted as 1970 anymore. --- timemodule.c: PyDoc_STRVAR(module_doc, => That's wrong. Example: time.gmtime(-55582200000).tm_year gives 208. --- /home/haypo/prog/HG/cpython/Modules/timemodule.c: In function 'PyInit_time': |
On Tue, Apr 26, 2011 at 6:09 PM, STINNER Victor <[email protected]> wrote:
What makes you say so? 1970 |
On Tue, Apr 26, 2011 at 6:09 PM, STINNER Victor <[email protected]> wrote:
This is wrong regardless of this patch. I don't mind fixing this, |
"What makes you say so? 1970" Don't write ">>> " using the email interface :-) -- >>> t
time.struct_time(tm_year=70, tm_mon=1, tm_mday=1, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=3, tm_yday=1, tm_isdst=0)
>>> time.mktime(t)
-59958144561.0
>>> time.localtime(_)
time.struct_time(tm_year=70, tm_mon=1, tm_mday=1, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=2, tm_yday=1, tm_isdst=0) Year 70 is considered as the year 70. |
On Tue, Apr 26, 2011 at 6:30 PM, STINNER Victor <[email protected]> wrote:
>
> STINNER Victor <[email protected]> added the comment:
>
> "What makes you say so?
>
> 1970"
>
> Don't write ">>> " using the email interface :-)
> Sorry. That was the output of time.strptime('70', '%y')[0]. |
On Tue, Apr 26, 2011 at 6:09 PM, STINNER Victor <[email protected]> wrote:
This one needs to be removed. Thanks. |
The next step is to update the datetime module: something like the attached patch (datetime_y2k.patch). |
Le mardi 26 avril 2011 à 22:20 +0000, Alexander Belopolsky a écrit :
"year (e.g. 1998)\n" is enough. |
New changeset e6f6ac8c2502 by Alexander Belopolsky in branch 'default': |
New changeset db2ac3dc6cc2 by Alexander Belopolsky in branch 'default': |
New changeset bfd741162741 by Alexander Belopolsky in branch 'default': |
Great! |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: