diff options
author | mike bayer <mike_mp@zzzcomputing.com> | 2021-03-31 18:46:48 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@ci3.zzzcomputing.com> | 2021-03-31 18:46:48 +0000 |
commit | e9c81a3adadd46fa9da4ddb1d0b82c2e8205cd5c (patch) | |
tree | 5581dde46fa58a34c7e3b54105294a15c5fcc202 | |
parent | 4029006c73ff4bf2f842388c72820d6b8cd27c6b (diff) | |
parent | d11356f444ece3310fb13cd83b4c6df913aca078 (diff) | |
download | sqlalchemy-e9c81a3adadd46fa9da4ddb1d0b82c2e8205cd5c.tar.gz |
Merge "Repair pg8000 disconnect patch"
-rw-r--r-- | doc/build/changelog/unreleased_14/6099.rst | 7 | ||||
-rw-r--r-- | lib/sqlalchemy/dialects/postgresql/pg8000.py | 6 |
2 files changed, 10 insertions, 3 deletions
diff --git a/doc/build/changelog/unreleased_14/6099.rst b/doc/build/changelog/unreleased_14/6099.rst new file mode 100644 index 000000000..6a5a299e5 --- /dev/null +++ b/doc/build/changelog/unreleased_14/6099.rst @@ -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. 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 |