Bug report
Bug description:
See
|
try: |
|
self.__notes__ = getattr(exc_value, '__notes__', None) |
|
except Exception as e: |
|
self.__notes__ = [ |
|
f'Ignored error getting __notes__: {_safe_string(e, '__notes__', repr)}'] |
try:
self.__notes__ = getattr(exc_value, '__notes__', None)
except Exception as e:
self.__notes__ = [
f'Ignored error getting __notes__: {_safe_string(e, '__notes__', repr)}']
The f-string on the last line contains single-quotes within the {_safe_string(e, '__notes__', repr)} expression.
I noticed this in 3.13.9, but it is the same in 3.14.2.
I confirmed that in 3.11.9, it is correct:
f'Ignored error getting __notes__: {_safe_string(e, "__notes__", repr)}'
I'm not exactly sure why this isn't causing problems everywhere.
CPython versions tested on:
3.13, 3.14
Operating systems tested on:
Windows
Bug report
Bug description:
See
cpython/Lib/traceback.py
Lines 1081 to 1085 in 487e91c
The f-string on the last line contains single-quotes within the
{_safe_string(e, '__notes__', repr)}expression.I noticed this in 3.13.9, but it is the same in 3.14.2.
I confirmed that in 3.11.9, it is correct:
f'Ignored error getting __notes__: {_safe_string(e, "__notes__", repr)}'I'm not exactly sure why this isn't causing problems everywhere.
CPython versions tested on:
3.13, 3.14
Operating systems tested on:
Windows