Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Connection factories override cursor_factories

#105

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...

Reported by Corry Haines · March 26th, 2012 @ 04:14 AM

State: resolved
Milestone: none
Assigned to: nobody

Activity

  1. Daniele Varrazzo
    Daniele Varrazzo
    • State changed from new to open

    It seems a good idea.

    March 26th, 2012 @ 10:31 PM

  2. Daniele Varrazzo
    Daniele Varrazzo
    • 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.

    April 11th, 2012 @ 05:14 PM