STINNER Victor victor.stin...@haypocalc.com added the comment:
time.asctime(), time.ctime() and time.strftime() are no more not limited for
the year field if accept2dyear=0. Except with Visual Studio or on Solaris: the
year is limited to the range [1; ].
--
Alexander Belopolsky belopol...@users.sourceforge.net added the comment:
Committed in 87829.
I added a year = 1900 check in time.strftime for now because removing or
relaxing this limit should be done in coordination with similar datetime module
issue. See #1777412.
See also python-dev
Alexander Belopolsky belopol...@users.sourceforge.net added the comment:
Commit link: r87829
--
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10827
___
STINNER Victor victor.stin...@haypocalc.com added the comment:
I tried time.asctime() on Windows 32 bits (compiled with Visual Studio) with
accept2dyear=False: it accepts years in [-2^31; 2^31-1], cool.
--
___
Python tracker rep...@bugs.python.org
Alexander Belopolsky belopol...@users.sourceforge.net added the comment:
Attached patch, issue10827c.diff, implements the following logic in gettmarg:
/* If year is specified with less that 4 digits, its interpretation
Changes by Alexander Belopolsky belopol...@users.sourceforge.net:
Added file: http://bugs.python.org/file20295/issue10827c.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10827
___
Alexander Belopolsky belopol...@users.sourceforge.net added the comment:
Attached patch, issue10827b.diff, fixes the accept2dyear = True issue and
removes unnecessary struct_time to tuple conversion, but otherwise does not
change the Y2K behavior. The code handling accept2dyear is refactored
New submission from Alexander Belopolsky belopol...@users.sourceforge.net:
http://docs.python.org/library/time.html#time-y2kissues
Values 100–1899 are always illegal.
Why are these values illegal? The GNU libc accepts year in [1900-2^31; 2^31-1]
(tm_year in [-2147483648; 2147481747]). If
Alexander Belopolsky belopol...@users.sourceforge.net added the comment:
The system libc would raise an error (return NULL) if it doesn't know
how to format years older than 1900.
As experience with asctime has shown, system libc can do whatever it pleases
with out of range values including
Changes by Andreas Stührk andy-pyt...@hammerhartes.de:
--
nosy: +Trundle
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10827
___
___
Alexander Belopolsky belopol...@users.sourceforge.net added the comment:
I am attaching a patch. While working on the patch, I noticed that although
time.accept2dyear is documented as boolean, the current code expects int and
treats any non-int including True as 0:
time.accept2dyear = True;
Alexander Belopolsky belopol...@users.sourceforge.net added the comment:
On Tue, Jan 4, 2011 at 1:30 PM, Alexander Belopolsky
rep...@bugs.python.org wrote:
..
This is clearly a bug. (Although Y2K note contradicts time.accept2dyear
documentation.)
PyObject_IsTrue() may fail - this is
Georg Brandl ge...@python.org added the comment:
But if it fails, why not just let it fail?
--
nosy: +georg.brandl
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10827
___
Alexander Belopolsky belopol...@users.sourceforge.net added the comment:
On Tue, Jan 4, 2011 at 1:49 PM, Georg Brandl rep...@bugs.python.org wrote:
..
But if it fails, why not just let it fail?
Sure. That's what I meant by fixing the patch. See new patch attached.
--
Added file:
14 matches
Mail list logo