Skip to content

Commit e8db04c

Browse files
committed
include a warning regarding the corrected DB-API connect exception.
1 parent 0316536 commit e8db04c

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

postgresql/release/distutils.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@
1919
from distutils.core import Extension, Command
2020

2121
LONG_DESCRIPTION = """
22+
.. warning::
23+
`postgresql.driver.dbapi20.connect` will now raise `ClientCannotConnectError` directly.
24+
Exception traps around connect should still function, but the `__context__` attribute
25+
on the error instance will be `None` in the usual failure case as it is no longer
26+
incorrectly chained. Trapping `ClientCannotConnectError` ahead of `Error` should
27+
allow both cases to co-exist in the event that data is being extracted from
28+
the `ClientCannotConnectError`.
29+
2230
py-postgresql is a set of Python modules providing interfaces to various parts
2331
of PostgreSQL. Primarily, it provides a pure-Python driver with some C optimizations for
2432
querying a PostgreSQL database.

0 commit comments

Comments
 (0)