[issue12022] AttributeError should report the same details when raised by lookup_special() as when raised in the REPL

2021-06-29 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue12022] AttributeError should report the same details when raised by lookup_special() as when raised in the REPL

2021-06-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 20a88004bae8ead66a205a125e1fe979376fc3ea by Serhiy Storchaka in branch 'main': bpo-12022: Change error type for bad objects in "with" and "async with" (GH-26809)

[issue12022] AttributeError should report the same details when raised by lookup_special() as when raised in the REPL

2021-06-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: PR 26809 makes "with" and "async with" raising TypeError instead of AttributeError for wrong types. -- ___ Python tracker ___

[issue12022] AttributeError should report the same details when raised by lookup_special() as when raised in the REPL

2021-06-20 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +gvanrossum ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue12022] AttributeError should report the same details when raised by lookup_special() as when raised in the REPL

2021-06-20 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +25391 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26809 ___ Python tracker

[issue12022] AttributeError should report the same details when raised by lookup_special() as when raised in the REPL

2021-06-19 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- assignee: -> serhiy.storchaka ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue12022] AttributeError should report the same details when raised by lookup_special() as when raised in the REPL

2021-06-19 Thread Irit Katriel
Irit Katriel added the comment: I've reproduced this on 3.11 (though the AttributeError is now on __enter__ and not __exit__ as was the case in msg135484): >>> import transaction >>> with transaction: pass ... Traceback (most recent call last): File "", line 1, in AttributeError:

[issue12022] AttributeError should report the same details when raised by lookup_special() as when raised in the REPL

2019-10-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Would not be better to change an AttributeError to TypeError? Seems this is the only place in the core when missing special method causes an AttributeError and not TypeError. -- nosy: +serhiy.storchaka ___

[issue12022] AttributeError should report the same details when raised by lookup_special() as when raised in the REPL

2011-05-23 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: hasattr(transaction, '__exit__') http://docs.python.org/dev/reference/datamodel#special-method-names explains that magic methods are looked up on the class, not on the instances. There’s a lot of code out there that erroneously checks for

[issue12022] AttributeError should report the same details when raised by lookup_special() as when raised in the REPL

2011-05-08 Thread Daniel Urban
Changes by Daniel Urban urban.dani...@gmail.com: -- nosy: +durban ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12022 ___ ___ Python-bugs-list

[issue12022] AttributeError should report the same details when raised by lookup_special() as when raised in the REPL

2011-05-07 Thread Daniel Holth
Daniel Holth dho...@fastmail.fm added the comment: Python should explain AttributeError in the same way when it's raised by the interpreter. The with: statement below should raise the second AttributeError, not the first. import transaction with transaction: pass AttributeError: __exit__

[issue12022] AttributeError should report the same details when raised by lookup_special() as when raised in the REPL

2011-05-07 Thread Daniel Holth
Daniel Holth dho...@fastmail.fm added the comment: Thank you Benjamin for following up on this issue -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12022 ___