This project is archived and is in readonly mode.
lobject (conn) can segfault with bad parameter
-
Daniele Varrazzo
- 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
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
Really? It doesn't seem so:
>>> cur = psycopg2.extensions.cursor([]) TypeError: argument 1 must be psycopg2._psycopg.connection, not list -
Daniele Varrazzo
- State changed from open to resolved
-
Voicu
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...