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 bup
Recipients bup, terry.reedy
Date 2019-11-04.23:45:56
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1572911156.46.0.933839006151.issue38689@roundup.psfhosted.org>
In-reply-to
Content
When the following program has been input (into 32 bit 3.8.0 Python running on windows 10), all IDLE processes and windows will immediately and irrevocably hang the instant the open parentheses at the end of the statement "Object(" is rendered.

However that's just my 90% sure guess of the cause, based on 
 how when the regular dict from this example is swapped with one that raises AttributeError instead of KeyError, a crash no longer occurs. Quite perplexing, seeing as neither exception is handled in get_argspec.

>>> if 1:
    from idlelib.calltip import get_argspec
    class Type(type):
        __class__ = property((__class__:={}).__getitem__,__class__.__setitem__)
    class Object(metaclass=Type):
        __slots__ = '__class__'
    get_argspec(Object)

    
Traceback (most recent call last):
  File "<pyshell#41>", line 7, in <module>
    get_argspec(Object)
  File "C:\Python38\lib\idlelib\calltip.py", line 141, in get_argspec
    argspec = str(inspect.signature(fob))
  File "C:\Python38\lib\inspect.py", line 3093, in signature
    return Signature.from_callable(obj, follow_wrapped=follow_wrapped)
  File "C:\Python38\lib\inspect.py", line 2842, in from_callable
    return _signature_from_callable(obj, sigcls=cls,
  File "C:\Python38\lib\inspect.py", line 2218, in _signature_from_callable
    if isinstance(obj, types.MethodType):
KeyError: <class '__main__.Object'>
History
Date User Action Args
2019-11-04 23:45:56bupsetrecipients: + bup, terry.reedy
2019-11-04 23:45:56bupsetmessageid: <1572911156.46.0.933839006151.issue38689@roundup.psfhosted.org>
2019-11-04 23:45:56buplinkissue38689 messages
2019-11-04 23:45:56bupcreate