tlocke / pg8000

A Pure-Python PostgreSQL Driver
BSD 3-Clause "New" or "Revised" License
515 stars 46 forks source link

Date type with infinity triggers ValueError #99

Closed indyspike closed 2 years ago

indyspike commented 2 years ago

When using a Date column type and a row containing 'infinity' for the value, the following error is generated.

ValueError: time data 'infinity' does not match format '%Y-%m-%d'

A quick fix in converters.py is to add the lines that capture infinity from timestamp_in(data) to date_in(data). Not sure if this will cause issues elsewhere.

tlocke commented 2 years ago

Good idea @indyspike, I've done that and released it as version 1.24.1.

tlocke commented 2 years ago

This has been fixed so I'll close the issue, but do re-open if it's still a problem.