[Python-Dev] Checking input range in time.asctime and time.ctime
alexander.belopolsky at gmail.com
Thu Jan 6 06:10:41 CET 2011
On Wed, Jan 5, 2011 at 10:50 PM, Guido van Rossum <guido at python.org> wrote:
> But what guarantees do we have that the system functions accept
> negative values for tm_year on all relevant platforms?
Also note that the subject of this thread is limited to "time.asctime
and time.ctime." The other functions came into discussion only
because the year range checking code is shared inside the time module.
If calling specific system functions such as strftime with tm_year <
0 is deemed unsafe, we can move the check to where the system function
is called. No system function is called from time.asctime anymore and
time.ctime(t) is now time.asctime(localtime(t)).
More information about the Python-Dev