Closed GoogleCodeExporter closed 8 years ago
This will fix it; there may be a better way, but this worked for me:
diff -r 5714ec754542 pysimplesoap/simplexml.py
--- a/pysimplesoap/simplexml.py Tue May 31 11:36:30 2011 +0100
+++ b/pysimplesoap/simplexml.py Wed Jun 15 16:57:24 2011 -0500
@@ -25,7 +25,14 @@
DEBUG = False
# Functions to serialize/unserialize special immutable types:
-datetime_u = lambda s: datetime.datetime.strptime(s, "%Y-%m-%dT%H:%M:%S")
+#datetime_u = lambda s: datetime.datetime.strptime(s, "%Y-%m-%dT%H:%M:%S.%f")
+def datetime_u(s):
+ fmt = "%Y-%m-%dT%H:%M:%S"
+ try:
+ return datetime.datetime.strptime(s, fmt)
+ except:
+ return datetime.datetime.strptime(s, fmt + ".%f")
+
datetime_m = lambda dt: dt.isoformat('T')
date_u = lambda s: datetime.datetime.strptime(s[0:10], "%Y-%m-%d").date()
date_m = lambda d: d.strftime("%Y-%m-%d")
Original comment by pjimen...@gmail.com
on 15 Jun 2011 at 9:59
Great, could you commit it?
I've made you contributor ;-)
Also, if you can, a test case would be helpful too.
Original comment by reingart@gmail.com
on 15 Jun 2011 at 10:19
Pushed as rev 16d61b27e9a8, with a test case in the __main__ section. No idea
how to mark this issue fixed though.
Original comment by pjimen...@gmail.com
on 16 Jun 2011 at 2:23
[deleted comment]
Closed, thanks.
Sorry, I forgot to give you Edit Issue permission, now you can modify this
tickets.
Original comment by reingart@gmail.com
on 16 Jun 2011 at 8:59
Original issue reported on code.google.com by
pjimen...@gmail.com
on 15 Jun 2011 at 9:58