]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Repair pg8000 disconnect patch
authorMike Bayer <mike_mp@zzzcomputing.com>
Wed, 31 Mar 2021 13:53:35 +0000 (09:53 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 31 Mar 2021 17:56:34 +0000 (13:56 -0400)
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

doc/build/changelog/unreleased_14/6099.rst [new file with mode: 0644]
lib/sqlalchemy/dialects/postgresql/pg8000.py

diff --git a/doc/build/changelog/unreleased_14/6099.rst b/doc/build/changelog/unreleased_14/6099.rst
new file mode 100644 (file)
index 0000000..6a5a299
--- /dev/null
@@ -0,0 +1,7 @@
+.. change::
+    :tags: bug, postgresql
+    :tickets: 6099
+
+    Fixed typo in the fix for :ticket:`6099` released in 1.4.4 that completely
+    prevented it from working correctly, i.e. the error message did not match
+    what was actually emitted by pg8000.
index cda0bc9415ba63e511fa7e0e7b17fc749fda3f18..43df6edea218087d0723dc2ec3dd32b81190f07d 100644 (file)
@@ -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