Roundup Tracker - Issues

Issue 1087746

classification
Date.pretty() throws exception
Type: Severity: normal
Components: None Versions:
process
Status: closed fixed
:
: : mstarzyk, richard
Priority: normal :

Created on 2004-12-19 00:38 by mstarzyk, last changed 2005-01-03 03:06 by richard.

Files
File name Uploaded Description Edit Remove
date.py.patch mstarzyk, 2004-12-19 00:38
Messages
msg1779 Author: [hidden] (mstarzyk) Date: 2004-12-19 00:38
Roundup 0.8.0.b1
Python 2.4

The tuple passed to time.strftime() has tm_yday=0 and 
that is causing the exception. Python docs say the value  
should be in range [1, 366]. 
Maybe it has changed since python 2.3, but I don't have 
2.3 installed right now to check this. 

Patch is attached.

Python 2.4 (#60, Nov 30 2004, 11:49:19) [MSC v.1310 
32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more 
information.
>>> from roundup.date import Date
>>> d = Date()
>>> d
<Date 2004-12-19.00:16:43.078000>
>>> d.pretty()
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "c:\python24\lib\site-packages\roundup\date.py", 
line 371, in pretty
    str = time.strftime(format, (self.year, self.month, self.
day,
ValueError: day of year out of range
msg1780 Author: [hidden] (richard) Date: 2005-01-03 03:06
Logged In: YES 
user_id=6405

Damn, it's switched to being enforced in python2.4 :( 
 
History
Date User Action Args
2004-12-19 00:38:39mstarzykcreate