I'm running into a weird problem where I'm unable to connect to PostgreSQL from a Python 3.2 install. I'm running Fedora 15 and have installed Python3 and PostgerSQL9 from the Fedora repositories using yum. Does anyone have any ideas on why I'm seeing this problem and how to correct it? Google searches haven't been turning up anything.
I've changed the username, password, and database, but my pg_hba.conf file is correct.
import postgresql
t = postgresql.open(user='validuser', password='secret', database='some_database')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib64/python3.2/site-packages/postgresql/__init__.py", line 88, in open
c.connect()
File "/usr/lib64/python3.2/site-packages/postgresql/driver/pq3.py", line 2419, in connect
pq = Connection3(sf, startup, password = password,)
File "/usr/lib64/python3.2/site-packages/postgresql/protocol/client3.py", line 514, in __init__
element.Startup(**startup), password
TypeError: keyword arguments must be strings
As a side note, I get this same error if I try to connect using different user, password, database combinations, and also if I use a pq://user:password@host/database
connection string instead of keywords, both to localhost and to remote hosts.