Python 3 compatibility, invalid dates in database

* Python 3 fix
* Return None when a date value can't be converted to a date. I'm not sure how widespread it is, but I needed to read a database where some dates were stored as year=0, month=0, day=0, making datetime.date raise a "year is out of range" ValueError.