I'm using python 2.7.x:
import datetime
...
def _log(error_level, message):
try:
d = datetime.datetime.now()
date_template = d.strftime("%Y.%m.%d - %H:%M:%S")
...
except:
sv_custom_utils.simple_exception_info()
In 99% it is running without any problems, but sometimes I get an error:
ERROR:root:
2018.11.21 - 15:58:25:
Top: file: [sv_logger.py], method: _log()
Root: file: [sv_logger.py], line 51, cause: in _log [date_template = d.strftime("%Y.%m.%d - %H:%M:%S")]
TypeError: a float is required
What could be a reason? Python is running on Ubuntu 16/18. Does that mean that d
should be a float?