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 ncoghlan
Recipients Jim Fasarakis-Hilliard, Julian, Sean.Ochoa, brett.cannon, eamanu, eric.araujo, ezio.melotti, ncoghlan, petri.lehtinen, rhettinger, serhiy.storchaka, terry.reedy, vstinner
Date 2017-05-28.04:58:54
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1495947536.04.0.888855841523.issue13349@psf.upfronthosting.co.za>
In-reply-to
Content
While I agree it's reasonable to keep arbitrary value repr's out of these messages by default, I do think it would be desirable for someone sufficiently motivated to file a separate RFE about adding the value as a structured exception attribute so that custom sys.excepthook implementations and other "unhandled runtime exception" loggers may choose to handle the situation differently.

This wouldn't be about the cases where code is handling the remove() or index() call directly, but rather about those where third party library code isn't handling missing values correctly, so the debugging scenario a developer is faced with looks more like this than it does the examples in the OP here:

```
>>> some_library_function()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<stdin>", line 2, in some_library_function
  File "<stdin>", line 2, in some_other_library_function
ValueError: list.remove(x): x not in list
```

Getting that kind of traceback in the logs for a production failure in a distributed system is all kinds of frustrating since you *know* the interpreter knew what "x" was when the error happened, it just isn't passing that information along to the developer that's trying to figure out how and why it broke.
History
Date User Action Args
2017-05-28 04:58:56ncoghlansetrecipients: + ncoghlan, brett.cannon, rhettinger, terry.reedy, vstinner, ezio.melotti, eric.araujo, Julian, petri.lehtinen, serhiy.storchaka, Sean.Ochoa, Jim Fasarakis-Hilliard, eamanu
2017-05-28 04:58:56ncoghlansetmessageid: <1495947536.04.0.888855841523.issue13349@psf.upfronthosting.co.za>
2017-05-28 04:58:56ncoghlanlinkissue13349 messages
2017-05-28 04:58:54ncoghlancreate