Skip to content

Handle missing password authentication cleanly - #1351

Draft
aryansk wants to merge 1 commit into
MagicStack:masterfrom
aryansk:fix/1286-missing-password-error
Draft

Handle missing password authentication cleanly#1351
aryansk wants to merge 1 commit into
MagicStack:masterfrom
aryansk:fix/1286-missing-password-error

Conversation

@aryansk

@aryansk aryansk commented Aug 16, 2026

Copy link
Copy Markdown

Summary

Avoid an internal AttributeError when PostgreSQL requests cleartext password authentication but the connection parameters do not contain a password.

Changes

  • detect a missing password before building the cleartext password message
  • raise an asyncpg InterfaceError with an actionable message instead of calling .encode() on None
  • add regression coverage for connecting to a password-authenticated role without supplying a password

Test plan

python -m unittest tests.test_connect.TestAuthentication.test_auth_password_cleartext_without_password

Fixes #1286

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Connect with passwordless DSN does not work

1 participant