[server] Do not use logilab.common.date.strptime in sqlutils
This function is aliased to datetime.datetime.strptime() and exists only
for compatibility with Python <= 2.5 which we no longer support.
--- a/cubicweb/server/sqlutils.py Mon Oct 30 09:08:35 2017 +0100
+++ b/cubicweb/server/sqlutils.py Mon Oct 30 09:14:36 2017 +0100
@@ -543,13 +543,11 @@
return _limit_size(text, maxsize)
cnx.create_function("TEXT_LIMIT_SIZE", 2, limit_size2)
- from logilab.common.date import strptime
-
def weekday(ustr):
try:
- dt = strptime(ustr, '%Y-%m-%d %H:%M:%S')
+ dt = datetime.strptime(ustr, '%Y-%m-%d %H:%M:%S')
except:
- dt = strptime(ustr, '%Y-%m-%d')
+ dt = datetime.strptime(ustr, '%Y-%m-%d')
# expect sunday to be 1, saturday 7 while weekday method return 0 for
# monday
return (dt.weekday() + 1) % 7