This project is archived and is in readonly mode.
Connection factories override cursor_factories
Reported by Corry Haines | March 26th, 2012 @ 04:14 AM
The cursor subclasses appear to have been coded to override the cursor_factory kwarg that can be passed to them.
If this was the intended behavior, then I guess this is not a bug, but it seems to be a very odd behavior. Because of this behavior, adding a connection factory to an existing app caused most of the cursors to break when their request for specific cursors was ignored.
So, I have patched the subclasses to allow the cursor_factory kwarg to override the connection_factory. It allows connection factories to be dropped into place without stomping all over existing code.
I have uploaded the patch to my github clone of psycopg: https://github.com/tabletcorry/psycopg2/commit/eb46f4f80794e37a16e0...
Comments and changes to this ticket
-
Daniele Varrazzo March 26th, 2012 @ 10:31 PM
- State changed from new to open
It seems a good idea.
-
Daniele Varrazzo April 11th, 2012 @ 05:14 PM
- State changed from open to resolved
I've integrated your patch in my devel, applied to other classes too and add some tests. Thank you.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
<b>WARNING:</b> the informations in this tracker are archived. Please submit new tickets or comments to <a href="https://github.com/psycopg/psycopg2/issues">the new tracker</a>.
<br/>
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.