Hi all,
Psycopg2 fails when trying to authenticate with spaces in a
password. The following code illustrates the problem:
>>> import psycopg2
>>> psycopg2.connect(database='amcat', host='localhost', user='martijn', port='5433', password='foo baar')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
psycopg2.OperationalError: missing "=" after "test" in connection info string
I've submitted a very simple patch, which resolves the problem,
but introduces another problem: the object returned shows part of
the password.
>>> psycopg2.connect(**params)
<connection object at 0x2449710; dsn: 'dbname=amcat host=localhost port=5433 user=martijn password=xxxxx baar', closed: 0>
I'm unable to locate the relevant lines. If anyone could point
me in the right direction, I'd be more than happy to fix the that
part too.
Kind regards,
Martijn