Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.3k
Closed
Description
Bug report
Bug description:
Code for demonstration:
>>>b"%i"%"str"Traceback (mostrecentcalllast):File"<python-input-0>",line1,in<module>b"%i"%"str"~~~~~~^~~~~~~TypeError:%dformat:arealnumberisrequired,notstr
Expected error message text:
TypeError:%iformat:arealnumberisrequired,notstr
Also for strings this message is output correctly:
>>>"%i"%"str"Traceback (mostrecentcalllast):File"<python-input-1>",line1,in<module>"%i"%"str"~~~~~^~~~~~~TypeError:%iformat:arealnumberisrequired,notstr
I would like to send a PR to fix this.
CPython versions tested on:
3.12, 3.13, 3.14, CPython main branch
Operating systems tested on:
Linux