On Wed, Dec 28, 2016 at 2:13 PM, Nathaniel Smith <n...@pobox.com> wrote:
> On Dec 28, 2016 12:44, "Brett Cannon" <br...@python.org> wrote: > > My quick on-vacation response is that attaching more objects to exceptions > is typically viewed as dangerous as it can lead to those objects being kept > alive longer than expected (see the discussions about richer error messages > to see that worry come out for something as simple as attaching the type to > a TypeError). > > > This isn't an issue for printing arguments or other locals in tracebacks, > though. The traceback printing code can access anything in the frame stack. > > -n > > Right. I'd actually be more worried about security leaks than memory leaks. Imagine you're calling a password checking function that got bytes instead of text, what amounts to a type check could leak the plaintext password. One rarely sees a C traceback, let alone a textual one, except during development, whereas Python tracebacks are seen during development and after deployment. Mahmoud https://github.com/mahmoud
_______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/