wulczer/txpostgres — Issue #11: Connection.connectionFactory and cursorFactory a treated as methods of Connection
Author: eallik
Created: 2011-12-12 16:42:11+00:00
State: open

in `txpostgres.py:248` you have:

```python
class Connection(_PollingMixin):
...
connectionFactory = psycopg2.connect
cursorFactory = Cursor
```

now later in that file in `Connection.connect` you have:

```python
self._connection = self.connectionFactory(*args, **kwargs)
```

The problem there is that, on Python 2.7 at least, `self.connectionFactory` is treated as a bound method of `Connection`, so `self` is passed in implicitly, causing `psycopg2.connect` to error out:

Traceback (most recent call last):
Failure: twisted.internet.defer.FirstError: FirstError[#0, [Failure instance: Traceback: : argument 1 must be string, not Connection
[snip]
--- ---
/Users/erik.allik/.virtualenvs/dts-agent/lib/python2.7/site-packages/txpostgres/txpostgres.py:293:connect
/Users/erik.allik/.virtualenvs/dts-agent/lib/python2.7/site-packages/psycopg2/__init__.py:179:connect
]]
```