Serhiy Storchaka added the comment:
I think ProgrammingError is not correct type of an exception. It is used for
programming errors such as using uninitialized or closed objects or supplying
incorrect number of bindings. But this error can be caused by invalid data in a
database created not by Python. Currently converters raise ValueError or
TypeError for invalid data. ValueError is raised for datetime without
microseconds but with timezone offset. I think ValueError is more appropriate
type for such errors.
Perhaps even TypeError should be converted to ValueError.
# parsing date or datetime
except (ValueError, TypeError):
Python tracker <rep...@bugs.python.org>
Python-bugs-list mailing list