Patches item #1578415, was opened at 2006-10-16 22:34
Message generated for change (Comment added) made by phd
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1578415&group_id=74338
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
>Resolution: Invalid
Priority: 5
Private: No
Submitted By: ptwobrussell (ptwobrussell)
>Assigned to: Oleg Broytmann (phd)
Summary: exception called b/c of issue with millisecs in date string
Initial Comment:
A patch to fix an issue caused when pgdb returns a
date/time string that contains milliseconds in it:
col.py.orig is the original file. col.py is the updated
file
Patch is inline below:
--- col.py.orig 2006-10-16 14:11:30.000000000 -0400
+++ col.py 2006-10-16 14:13:28.000000000 -0400
@@ -941,7 +941,8 @@
else:
return
datetime.time(value.hour, value.minute, int(value.second))
try:
- stime = time.strptime(value, self.format)
+ #postgres might return a time value
with milliseconds. strip it or else change the format
string
+ stime =
time.strptime(value[value.rfind('.')], self.format)
except:
raise validators.Invalid("expected an
date/time string of the '%s' format in the DateTimeCol
'%s', got %s %r instead" % \
(self.format, self.name,
type(value), value), value, state)
----------------------------------------------------------------------
>Comment By: Oleg Broytmann (phd)
Date: 2006-11-10 17:22
Message:
Logged In: YES
user_id=4799
value[value.rfind('.')]? There have to be a colon somewhere:
value[:value.rfind('.')], I suppose?
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1578415&group_id=74338
|