Reviewers: ,


Please review this at http://codereview.tryton.org/710003/

Affected files:
  M trytond/backend/sqlite/database.py


Index: trytond/backend/sqlite/database.py
===================================================================
--- a/trytond/backend/sqlite/database.py
+++ b/trytond/backend/sqlite/database.py
@@ -6,6 +6,7 @@
 import re
 from decimal import Decimal
 import datetime
+import logging
 import time
 import sys
 import threading
@@ -39,9 +40,13 @@
             hours, minutes, seconds = map(int, timepart_full[0].split(":"))
             if len(timepart_full) == 2:
                 microseconds = int(timepart_full[1])
+            else:
+                microseconds = 0
date = datetime.datetime(year, month, day, hours, minutes, seconds,
                     microseconds)
-    except Exception:
+    except Exception, err:
+        logger = logging.getLogger('sql')
+        logger.info("Could not extract date '%s': %s" % (date, err))
         return None
     if lookup_type.lower() == 'century':
         return date.year / 100 + (date.year % 100 and 1 or 0)


--
--
[email protected] mailing list

--- You received this message because you are subscribed to the Google Groups "tryton-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to