[issue25538] Traceback from __exit__ method is misleading

2020-07-17 Thread Tadhg McDonald-Jensen
Tadhg McDonald-Jensen added the comment: uploaded `with_traceback_fixed+async.py` because I forgot to include async with in my first code. -- Added file: https://bugs.python.org/file49323/with_traceback_fixed+async.py ___ Python tracker <ht

[issue25538] Traceback from __exit__ method is misleading

2020-07-17 Thread Tadhg McDonald-Jensen
Tadhg McDonald-Jensen added the comment: This is doable, the feature that decides which line is shown in the traceback is the `lnotab` structure in the relevant code object, the structure is described here (https://github.com/python/cpython/blob/3.8/Objects/lnotab_notes.txt

[issue29922] error message when __aexit__ is not async

2017-03-27 Thread Tadhg McDonald-Jensen
Tadhg McDonald-Jensen added the comment: > This is a specific example of the general problem reported in issue 25538. Definitely related, although the part of giving an error "... can't be used in 'await' expression" when no await expression is used isn't covered by that

[issue29922] error message when __aexit__ is not async

2017-03-27 Thread Tadhg McDonald-Jensen
New submission from Tadhg McDonald-Jensen: When creating a asynchronous context manager if the __aexit__ method is not labeled as async (so it returns None instead of a coroutine) the error has a generic error message: TypeError: object NoneType can't be used in 'await' expression Would

[issue29043] dict view string representations are misleading

2016-12-21 Thread Tadhg McDonald-Jensen
New submission from Tadhg McDonald-Jensen: Currently the string representation for dictionary views are a bit misleading as they look like valid expression but isn't: >>> {'a':1, 'b':2}.keys() dict_keys(['b', 'a']) >>> dict_keys = type({}.keys()) #get a ref

[issue26627] IDLE incorrectly labeling error as internal

2016-03-23 Thread Tadhg McDonald-Jensen
Tadhg McDonald-Jensen added the comment: other then bdb.py all of the excluded modules are imported into idlelib.run so that line could be replaced with: import bdb exclude = (__file__, rpc.__file__, threading.__file__, queue.__file__, RemoteDebugger.__file__, bdb.__file__

[issue26627] IDLE incorrectly labeling error as internal

2016-03-23 Thread Tadhg McDonald-Jensen
New submission from Tadhg McDonald-Jensen: (I apologize if I'm doing something wrong) When using a file named run.py in idle, any errors raised from the module makes IDLE show a traceback like this: Traceback (most recent call last): ** IDLE Internal Exception: File "/Library/Frame