[egenix-users] Incorrect handle of 2 digit year in ARPA module
Arso - Gentoo
arso at libero.it
Mon Sep 19 23:50:54 CEST 2005
This happen on Li nux Gentoo using package egenix-mx-base-2.0.5.
Parsing a date in format 'Wed, 14 Sep 05 11:28:48 +0100' with
DateTime.ARPA.ParseDateTimeUTC('Wed, 14 Sep 05 11:28:48 +0100')
occurs the error
File "/usr/lib/python2.3/site-packages/mx/DateTime/ARPA.py", line 155,
in ParseDateTimeGMT
return DateTime.DateTime(year,month,day,hour,minute,second) - offset
TypeError: an integer is required
this becouse after the split in date items at line 133
litday,day,litmonth,month,year,hour,minute,second,zone = date.groups()
the missing century is handled by calling
DateTime.add_century(year)
while year is string, so the add_century does not work.
I suggest tu use instead on line 135
DateTime.add_century(atoi(year))
The same on line 67 and 98.
--
======================================================
Arso - Italy Gentoo 2004-02 Stage 1
Armada e500
======================================================
More information about the egenix-users
mailing list