This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author moi90
Recipients moi90
Date 2021-03-29.09:36:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1617010609.77.0.749976985588.issue43656@roundup.psfhosted.org>
In-reply-to
Content
With `capture_locals=True`, `StackSummary.format` prints the local variables for every frame:
https://github.com/python/cpython/blob/4827483f47906fecee6b5d9097df2a69a293a85c/Lib/traceback.py#L440

This will fail, however, if string conversion fails.

StackSummary.format should be robust towards such possibilities.


An easy fix would be a utility function:

```
def try_str(x):
  try:
    return str(x)
  except:
    return "<some sensible hint>"
```
History
Date User Action Args
2021-03-29 09:36:49moi90setrecipients: + moi90
2021-03-29 09:36:49moi90setmessageid: <1617010609.77.0.749976985588.issue43656@roundup.psfhosted.org>
2021-03-29 09:36:49moi90linkissue43656 messages
2021-03-29 09:36:49moi90create