1. Eventlet
  2. Untitled project
  3. eventlet
  4. Issues
Issue #158 resolved

Eventlet pooled Psycopg2 connections won't support cursor as context manager

Eric Urban
created an issue

In psycopg2, the connection object can be used to get a cursor. You can use this as a context manager so you don't manually have to close the cursor. This works fine. When I get a psycopg2 connection object from an eventlet.db_pool.ConnectionPool the same idiom doesn't work.

Not sure if I am doing something wrong or this is legitimate bug. Please see the attached file. It blows up with an AttributeError when the with statement is used.