Skip to content

Commit 685f4bc

Browse files
committed
Fix error message parsing logic when password is needed
The string 'fe_sendauth: ...' is just a part of the error message, so we must not check for equality.
1 parent 5dfd4f0 commit 685f4bc

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
### Fixed
1010

1111
* At startup, do not show a traceback upon failure to connect to PostgreSQL.
12+
* Fix password prompt not shown with psycopg2 backend.
1213

1314
### Misc
1415

pgactivity/data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ def pg_connect(
537537
if nb_try < 1 and (
538538
isinstance(err, pg.InvalidPassword)
539539
or errmsg.startswith("FATAL: password authentication failed for user")
540-
or errmsg == "fe_sendauth: no password supplied"
540+
or "fe_sendauth: no password supplied" in errmsg
541541
):
542542
password = getpass.getpass()
543543
elif exit_on_failed:

0 commit comments

Comments
 (0)