Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Document that asyncpg error messages no longer include DETAIL in 2.1

Open Beginner friendly
#13,655 0 comments 1 reaction 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
1-3 hours
Newbie friendliness
82/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Active
Tech stack
python, sqlalchemy

Research direction

Start with the 2.1 changelog entry for #8047 and the migration notes, which the issue identifies as missing the message change. Document that asyncpg error messages no longer include the DETAIL: line, and point readers to .sqlstate, .detail, and driver_exception instead. Done when the 2.1 documentation explains the change and its replacement attributes.

Written by the indexing model from the issue text.

Description

Describe the documentation issue

For asyncpg on 2.1, str(exc.orig) / exc.orig.args[0] (and so str(DBAPIError)) no longer include the DETAIL: line. On 2.0 they included it, because the message was built as "%s: %s" % (type(error), error). This came with the EmulatedDBAPIException change in 89a4174a8d (#8047). The detail is still available as exc.orig.detail and through exc.driver_exception.

The 2.1 changelog entry for #8047 describes the new attributes but not the message change. Downstream code that parsed the message, for example advanced-alchemy's duplicate-key detection (litestar-org/advanced-alchemy#803), broke silently, and logs lost the Key (...)=(...) information.

I'm not asking to change the behavior back, since structured attributes are better. Could the migration notes / changelog mention it, and point to .sqlstate / .detail / driver_exception as the replacement?

Dominant language
Python
Stars
12.2k
Forks
1.8k
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from sqlalchemy/sqlalchemy

All issues in sqlalchemy/sqlalchemy

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.