Skip to content

Add attributes to tomllib.TOMLDecodeError #126175

Closed
@hukkin

Description

@hukkin

Feature or enhancement

Proposal:

Add the same attributes to tomllib.TOMLDecodeError that json.JSONDecodeError also has, namely: msg, doc, pos, lineno, colno. This will help user facing apps show customized errors to users.

This draft PR in Tomli shows the proposed changes.

Has this already been discussed elsewhere?

I have already discussed this feature proposal on Discourse

Links to previous discussion of this feature:

https://discuss.python.org/t/69546

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibPython modules in the Lib dirtype-featureA feature request or enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions