Message285375
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.
try:
# parsing date or datetime
except (ValueError, TypeError):
raise ValueError(...) |
|
Date |
User |
Action |
Args |
2017-01-13 10:21:51 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, lemburg, ghaering, belopolsky, xiang.zhang, bozo.kopic |
2017-01-13 10:21:51 | serhiy.storchaka | set | messageid: <1484302911.47.0.669066956696.issue29099@psf.upfronthosting.co.za> |
2017-01-13 10:21:51 | serhiy.storchaka | link | issue29099 messages |
2017-01-13 10:21:51 | serhiy.storchaka | create | |
|