- Fixed "table" argument on constructor of ForeginKeyConstraint
[ticket:1571]
+ - Fixed bug in connection pool cursor wrapper whereby if a
+ cursor threw an exception on close(), the logging of the
+ message would fail. [ticket:1786]
+
- engines
- Fixed building the C extensions on Python 2.4. [ticket:1781]
ex_text = str(e)
except TypeError:
ex_text = repr(e)
- self.__parent._logger.warn("Error closing cursor: %s", ex_text)
+ self._parent._logger.warn("Error closing cursor: %s", ex_text)
if isinstance(e, (SystemExit, KeyboardInterrupt)):
raise
assert not conn.invalidated
assert len(dbapi.connections) == 1
+class CursorErrTest(TestBase):
+
+ def setup(self):
+ global db, dbapi
+
+ class MDBAPI(MockDBAPI):
+ def connect(self, *args, **kwargs):
+ return MConn(self)
+
+ class MConn(MockConnection):
+ def cursor(self):
+ return MCursor(self)
+
+ class MCursor(MockCursor):
+ def close(self):
+ raise Exception("explode")
+
+ dbapi = MDBAPI()
+
+ # create engine using our current dburi
+ db = tsa.create_engine('postgresql://foo:bar@localhost/test', module=dbapi, _initialize=False)
+
+ def test_cursor_explode(self):
+ conn = db.connect()
+ result = conn.execute("select foo")
+ result.close()
+ conn.close()
+
engine = None
class RealReconnectTest(TestBase):
def setup(self):