The gdbm backend assumes that dates are stored in the format "%Y-%m-%d %H:%M:%S.%f" which is usually true:
str(datetime.datetime(2014, 8, 14, 11, 42, 17, 1337))
'2014-08-14 11:42:17.001337'
However, if a record is inserted exactly "on the second", the microseconds are removed:
str(datetime.datetime(2014, 8, 14, 11, 42, 17, 0))
'2014-08-14 11:42:17'
on busy servers this happens sometimes, and after a restart, the database can not be loaded:
Traceback (most recent call last):
File "/usr/bin/pyzord", line 4, in <module>
__import__('pkg_resources').run_script('pyzor==0.8.0', 'pyzord')
File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 534, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 1445, in run_script
exec(script_code, namespace, namespace)
File "/usr/lib/python2.7/site-packages/pyzor-0.8.0-py2.7.egg/EGG-INFO/scripts/pyzord", line 389, in <module>
File "/usr/lib/python2.7/site-packages/pyzor-0.8.0-py2.7.egg/EGG-INFO/scripts/pyzord", line 363, in main
File "build/bdist.linux-x86_64/egg/pyzor/engines/gdbm_.py", line 40, in __init__
File "build/bdist.linux-x86_64/egg/pyzor/engines/gdbm_.py", line 100, in start_reorganizing
File "build/bdist.linux-x86_64/egg/pyzor/engines/gdbm_.py", line 65, in apply_method
File "build/bdist.linux-x86_64/egg/pyzor/engines/gdbm_.py", line 111, in _really_reorganize
File "build/bdist.linux-x86_64/egg/pyzor/engines/gdbm_.py", line 71, in _really_getitem
File "build/bdist.linux-x86_64/egg/pyzor/engines/gdbm_.py", line 143, in decode_record
File "build/bdist.linux-x86_64/egg/pyzor/engines/gdbm_.py", line 162, in decode_record_1
File "build/bdist.linux-x86_64/egg/pyzor/engines/gdbm_.py", line 23, in <lambda>
File "/usr/lib/python2.7/_strptime.py", line 325, in _strptime
(data_string, format))
ValueError: time data '2014-07-03 14:59:31' does not match format '%Y-%m-%d %H:%M:%S.%f'
The gdbm backend assumes that dates are stored in the format "%Y-%m-%d %H:%M:%S.%f" which is usually true:
However, if a record is inserted exactly "on the second", the microseconds are removed:
on busy servers this happens sometimes, and after a restart, the database can not be loaded: