[issue30639] inspect.getfile(obj) calls object repr on failure

2017-10-24 Thread Yury Selivanov
Yury Selivanov added the comment: Thank you, Thomas. -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker ___

[issue30639] inspect.getfile(obj) calls object repr on failure

2017-10-24 Thread Yury Selivanov
Yury Selivanov added the comment: New changeset e968bc735794a7123f28f26d68fdf5dc8c845280 by Yury Selivanov (Thomas Kluyver) in branch 'master': bpo-30639: Lazily compute repr for error (#2132) https://github.com/python/cpython/commit/e968bc735794a7123f28f26d68fdf5dc8c845280 -- nosy:

[issue30639] inspect.getfile(obj) calls object repr on failure

2017-06-12 Thread Thomas Kluyver
Thomas Kluyver added the comment: OK, I've updated the PR to do that. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsu

[issue30639] inspect.getfile(obj) calls object repr on failure

2017-06-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The address of the object is not informative. The possibility of getting a source file is determined by the type of the object. -- ___ Python tracker ___

[issue30639] inspect.getfile(obj) calls object repr on failure

2017-06-12 Thread Thomas Kluyver
Thomas Kluyver added the comment: Sure, I can do that if you want. The other thing I thought of was using object.__repr__, so the repr always shows like . -- ___ Python tracker ___

[issue30639] inspect.getfile(obj) calls object repr on failure

2017-06-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think in that case it is enough to report just type name. -- nosy: +serhiy.storchaka type: behavior -> enhancement versions: +Python 3.7 ___ Python tracker

[issue30639] inspect.getfile(obj) calls object repr on failure

2017-06-12 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- keywords: +easy ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.p

[issue30639] inspect.getfile(obj) calls object repr on failure

2017-06-12 Thread Thomas Kluyver
Changes by Thomas Kluyver : -- pull_requests: +2186 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue30639] inspect.getfile(obj) calls object repr on failure

2017-06-12 Thread Thomas Kluyver
Thomas Kluyver added the comment: Not exactly a bug, but I think that an improvement is possible. My plan is to delay computing the repr until the error is formatted, so that code which catches the TypeError can carry on safely. I think this is more relevant for inspect than for many other mod

[issue30639] inspect.getfile(obj) calls object repr on failure

2017-06-12 Thread R. David Murray
R. David Murray added the comment: What is your proposed solution? This doesn't at the moment sound like a bug in Python to me. -- nosy: +r.david.murray ___ Python tracker ___

[issue30639] inspect.getfile(obj) calls object repr on failure

2017-06-12 Thread Thomas Kluyver
New submission from Thomas Kluyver: This came up in IPython & Jedi: several functions in inspect end up calling getfile(). If the object is something for which it can't find the source file, it throws an error, the message for which contains the object's repr. This is problematic for us becaus