[issue43656] StackSummary.format fails if str(value) fails

2021-05-08 Thread Andrei Kulakov
Andrei Kulakov added the comment: @Martin it's more that logic in a function may raise exception and it will be handled somewhere upstream, but a repr should just give you a simple representation of an object, it would make no sense for upstream logic to be "object repr failed with such

[issue43656] StackSummary.format fails if str(value) fails

2021-05-07 Thread Irit Katriel
Irit Katriel added the comment: I think it's the other way around - the documentation usually states what exceptions a function can raise as part of its published API, not which exceptions it should not raise. -- ___ Python tracker

[issue43656] StackSummary.format fails if str(value) fails

2021-04-02 Thread Terry J. Reedy
Change by Terry J. Reedy : -- versions: -Python 3.6, Python 3.7 ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue43656] StackSummary.format fails if str(value) fails

2021-03-30 Thread Martin
Martin added the comment: I can't find any mention of this in the documentation: https://docs.python.org/3/reference/datamodel.html#object.__repr__ https://docs.python.org/3/library/functions.html#repr I think this should be mentioned somewhere. --

[issue43656] StackSummary.format fails if str(value) fails

2021-03-30 Thread Martin
Martin added the comment: I didn't know repr is supposed to always succeed. Does the documentation mention this? -- ___ Python tracker ___

[issue43656] StackSummary.format fails if str(value) fails

2021-03-30 Thread Irit Katriel
Irit Katriel added the comment: See issue39228. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue43656] StackSummary.format fails if str(value) fails

2021-03-30 Thread Martin
Martin added the comment: Yes, it is repr in FrameSummary.__init__. -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue43656] StackSummary.format fails if str(value) fails

2021-03-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Why str() is called at all? Would not be better to use repr()? -- nosy: +serhiy.storchaka ___ Python tracker ___

[issue43656] StackSummary.format fails if str(value) fails

2021-03-30 Thread Irit Katriel
Change by Irit Katriel : -- nosy: +iritkatriel ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue43656] StackSummary.format fails if str(value) fails

2021-03-29 Thread Martin
Change by Martin : -- keywords: +patch pull_requests: +23812 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25062 ___ Python tracker ___

[issue43656] StackSummary.format fails if str(value) fails

2021-03-29 Thread Martin
Martin added the comment: I have to correct myself: The conversion to string already happens during construction, in `FrameSummary.__init__`: https://github.com/python/cpython/blob/4827483f47906fecee6b5d9097df2a69a293a85c/Lib/traceback.py#L273 The issue remains as severe and the fix remains

[issue43656] StackSummary.format fails if str(value) fails

2021-03-29 Thread Martin
New submission from Martin : 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.