[Python-bugs-list] [ python-Bugs-538369 ] time.mktime() doesn't raise exception

noreply@sourceforge.net noreply@sourceforge.net
Tue, 02 Apr 2002 11:44:42 -0800


Bugs item #538369, was opened at 2002-04-02 13:25
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=538369&group_id=5470

Category: Python Library
Group: Python 2.2.1 candidate
Status: Open
Resolution: None
>Priority: 7
Submitted By: Mike Carifio (carifio)
>Assigned to: Barry Warsaw (bwarsaw)
Summary: time.mktime() doesn't raise exception

Initial Comment:
RH 6.2/alpha, egcs-2.91 , python 2.2.1c2:

import time
time.mktime((999999,)*9)

should raise and exception. It doesn't.
This is similar to bug 460357, where this
occurs on Sparc64.


----------------------------------------------------------------------

>Comment By: Tim Peters (tim_one)
Date: 2002-04-02 14:44

Message:
Logged In: YES 
user_id=31435

Assigned to Barry and boosted priority -- please fix this 
in a way you can live with.  Neither C nor POSIX define the 
range of time_t, and test_time's belief that test_mktime() 
*should* raise OverflowError seems pure assumption to me.

----------------------------------------------------------------------

Comment By: Michael Hudson (mwh)
Date: 2002-04-02 13:49

Message:
Logged In: YES 
user_id=6656

Well, I don't know what mktime should do either :-/

Yes, there's a bug here.  Tests shouldn't fail on 64bit 
platforms (the same thing happens on IA64, too).  I don't 
know the issues well enough to fix it myself, though.


----------------------------------------------------------------------

Comment By: Mike Carifio (carifio)
Date: 2002-04-02 13:45

Message:
Logged In: YES 
user_id=503643

I guess I misunderstood the spec on time.mktime().
I was under the impression that if one of the
slots in the tuple, like seconds, was out of range,
then it should raise an exception. It doesn't and
it doesn't do it on RH7.1/i386/python 2.2 or
Win2k/i386/python 2.2.

But, in my defense, test_time says it *should* raise
an exception. Which is where I started. 

----------------------------------------------------------------------

Comment By: Michael Hudson (mwh)
Date: 2002-04-02 13:36

Message:
Logged In: YES 
user_id=6656

Why should it?  Isn't this just a bug in the test?  (Not 
rhetorical questions!)


----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=538369&group_id=5470