[Sqlalchemy-tickets] Issue #3063: engine/base -> safe_close_cursor assumes our connection has a _lo
Brought to you by:
zzzeek
|
From: Mike B. <iss...@bi...> - 2014-05-30 16:45:26
|
New issue 3063: engine/base -> safe_close_cursor assumes our connection has a _logger https://bitbucket.org/zzzeek/sqlalchemy/issue/3063/engine-base-safe_close_cursor-assumes-our Mike Bayer: it's very tough to figure out how to reproduce this one. If you get a non-disconnect exception, but an unclosable cursor within first connect, the exception is squashed because we have a DBAPI connection in first_connect, not a connection fairy. ``` #!python def _safe_close_cursor(self, cursor): """Close the given cursor, catching exceptions and turning into log warnings. """ try: cursor.close() except (SystemExit, KeyboardInterrupt): raise except Exception: self.connection._logger.error( "Error closing cursor", exc_info=True) ``` |