You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The only reason for closing a psycopg2 cursor is to prevent its further
usage. Cursors created internally when using runQuery and runOperation are
never surfaced to the user, so there's no need to explicitly close them.
Issue #35 spurred an effort to make sure all generated cursors are always
closed, but it now seems that it's not the right way to go about the
problem. There's no benefit to forcing psycopg2 cursors to be closed and if the
cursor (or connection) are in a bad state, it risks throwing suprious errors.
Leave it to psycopg2 to deal with cursors going away and simply fix
runInteraction's docstring to explicitly say that the user should not close the
cursor they got passed.
0 commit comments