From d11356f444ece3310fb13cd83b4c6df913aca078 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Wed, 31 Mar 2021 09:53:35 -0400 Subject: Repair pg8000 disconnect patch For unknown reasons a space character got into the error message being tested in #6099. The fix is entirely non working in 1.4.4. Fixes: #6099 Change-Id: Ib2929be59d62eb2446fc8f040293c9228df7a531 --- lib/sqlalchemy/dialects/postgresql/pg8000.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/sqlalchemy/dialects/postgresql/pg8000.py') diff --git a/lib/sqlalchemy/dialects/postgresql/pg8000.py b/lib/sqlalchemy/dialects/postgresql/pg8000.py index cda0bc941..43df6edea 100644 --- a/lib/sqlalchemy/dialects/postgresql/pg8000.py +++ b/lib/sqlalchemy/dialects/postgresql/pg8000.py @@ -328,9 +328,9 @@ class PGDialect_pg8000(PGDialect): return ([], opts) def is_disconnect(self, e, connection, cursor): - if isinstance( - e, self.dbapi.InterfaceError - ) and "network error" in str(e): + if isinstance(e, self.dbapi.InterfaceError) and "network error" in str( + e + ): # new as of pg8000 1.19.0 for broken connections return True -- cgit v1.2.1