-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
Closed as not planned
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Edit: It looks like this was fixed in #124587 but either regressed or that hasn't been released yet? It was merged October 2024.
Bug description:
If you call tomllib.loads()
and mistakenly pass in a bytes object instead of a string...
tomllib.loads(b'a="asdf"')
...you get a TypeError as expected, but the error message is wrong:
TypeError: a bytes-like object is required, not 'str'
The error message should be the reverse, something like "a string-like object is required, not 'bytes'".
The bug is present on macOS with the following versions:
- 3.13.3
- 3.12.10
- 3.11.12
CPython versions tested on:
3.13, 3.12, 3.11
Operating systems tested on:
macOS
Metadata
Metadata
Assignees
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error