This project is archived and is in readonly mode.
lobject (conn) can segfault with bad parameter
Reported by Psycopg website | 2013-11-26 18:38:15 UTC
Submitted by: Voicu Hodrea
attempting to create an lobject but giving a wrong parameter (something which is not a connection object) will segfault python
Comments and changes to this ticket
-

Daniele Varrazzo 2013-11-27 11:17:12 UTC
- State changed from new to open
Thank you for the report. Args should be parsed using
O!instead ofO. Seecursor_init()for an example. -

Voicu 2013-11-27 11:30:44 UTC
Hmm, I tested what happens when doing psycopg2.extensions.cursor(<not a conn object>) and the result is weird - the cursor object is created and it lets you do operations but fails in unexpected ways - the query fails with the exception "cursor already closed" which is not very descriptive IMHO.
-

Daniele Varrazzo 2013-11-27 12:06:51 UTC
Really? It doesn't seem so:
>>> cur = psycopg2.extensions.cursor([]) TypeError: argument 1 must be psycopg2._psycopg.connection, not list -

Daniele Varrazzo 2013-11-27 12:45:49 UTC
- State changed from open to resolved
-

Voicu 2013-11-27 13:35:58 UTC
Hmm, I now see I'm on an earlier version actually (2.4.5)
>>> import psycopg2.extensions as ex >>> ex.cursor([]) <cursor object at 0x00000000026B9B40; closed: 0>Thanks for the fix, I should probably update...
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
WARNING: the informations in this tracker are archived. Please submit new tickets or comments to the new tracker.
Psycopg is the most used PostgreSQL adapter for the Python programming language. At the core it fully implements the Python DB API 2.0 specifications. Several extensions allow access to many of the features offered by PostgreSQL.