mvantellingen/psycopg2-ctypes — pull request #30 by intgr (2013-05-10 19:01:32+00:00)
Title: Datetime infinity

First patch changes psycopg2ct so that the test_dates.py test can actually run. Turns out that psycopg2ct fails 7 of these tests.

The second patch fixes parsing of "inifinity" timestamp/date values and adds an additional test for this.

```python
>>> db=psycopg2.connect(''); c=db.cursor(); c.execute("select timestamp 'infinity'"); c.fetchone()
(datetime.datetime(9999, 12, 31, 23, 59, 59, 999999),)
>>> db=psycopg2ct.connect(''); c=db.cursor(); c.execute("select timestamp 'infinity'"); c.fetchone()
Traceback (most recent call last):
File "", line 1, in
File "/usr/lib/python2.7/site-packages/psycopg2ct/_impl/cursor.py", line 22, in check_closed_
return func(self, *args, **kwargs)
File "/usr/lib/python2.7/site-packages/psycopg2ct/_impl/cursor.py", line 35, in check_no_tuples_
return func(self, *args, **kwargs)
File "/usr/lib/python2.7/site-packages/psycopg2ct/_impl/cursor.py", line 293, in fetchone
row = self._build_row(self._rownumber)
File "/usr/lib/python2.7/site-packages/psycopg2ct/_impl/cursor.py", line 830, in _build_row
val = typecasts.typecast(self._casts[i], val, length, self)
File "/usr/lib/python2.7/site-packages/psycopg2ct/_impl/typecasts.py", line 57, in typecast
return caster.cast(value, cursor, length)
File "/usr/lib/python2.7/site-packages/psycopg2ct/_impl/typecasts.py", line 27, in cast
return self.caster(value, length, cursor)
File "/usr/lib/python2.7/site-packages/psycopg2ct/_impl/typecasts.py", line 223, in parse_datetime
date, time = value.split(' ')
ValueError: need more than 1 value to unpack
```