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

noreply@sourceforge.net noreply@sourceforge.net
Wed, 03 Apr 2002 01:39:34 -0800


Bugs item #538369, was opened at 2002-04-02 20: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: Closed
>Resolution: Duplicate
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: Martin v. Löwis (loewis)
Date: 2002-04-03 11:39

Message:
Logged In: YES 
user_id=21627

This is a duplicate of #460357, so closing it as such.

This is not a serious problem; the test verifies that mktime
does not attempt to represent a date that is unrepresentable
(in a time_t). It turns out that the date selected is indeed
representable in a time_t on 64bit architectures, but not on
32-bit architectures.

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

Comment By: Tim Peters (tim_one)
Date: 2002-04-02 21: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 20: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 20: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 20: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