Bugs item #2923972, was opened at 2009-12-31 04:51
Message generated for change (Comment added) made by phd
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=540672&aid=2923972&group_id=74338
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Postgres
Group: SQLObject release (specify)
>Status: Closed
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: dkeeney (dvkeeney)
>Assigned to: Oleg Broytman (phd)
Summary: query method on connection
Initial Comment:
In the end of makeConnection, in postgres/pg_connection.py, the method 'query' is called on the connection object.
The connection object has just been created using a call to one or another DB API constructors, and the DB API spec does not have a 'query' method. As far as I know, the psycopg2 implementation does not have such a method either.
I patched my copy by adding an hasattr call to verify the existence of 'query' method, but I suspect a better fix is to use method is .execute, so the end of makeConnection would be:
dbEncoding = self.dbEncoding
if dbEncoding: # and hasattr(conn,'query'):
conn.execute("SET client_encoding TO %s",dbEncoding)
return conn
----------------------------------------------------------------------
>Comment By: Oleg Broytman (phd)
Date: 2010-01-06 18:48
Message:
Fixed in the revisions 4067, 4068 (branch 0.12 and the trunk.) Thank you!
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=540672&aid=2923972&group_id=74338
|