[New-bugs-announce] [issue16630] IDLE: Calltip fails if __getattr__ raises exception

Roger Serwy report at bugs.python.org
Fri Dec 7 02:46:15 CET 2012


New submission from Roger Serwy:

The calltip fails if __getattr__ raises an exception. Take as an example:


Python 3.4.0a0 (default:0238cc842805+, Dec  6 2012, 19:17:04) 
[GCC 4.7.2] on linux
Type "copyright", "credits" or "license()" for more information.
>>> class Test:
	def __getattr__(self, name):
		raise Exception()

	
>>> a = Test()
>>> a(

This traceback is sent to stderr:

Exception in Tkinter callback
Traceback (most recent call last):
  File "/home/serwy/Code/python/cpython/Lib/tkinter/__init__.py", line 1442, in __call__
    return self.func(*args)
  File "/home/serwy/Code/python/cpython/Lib/idlelib/MultiCall.py", line 166, in handler
    r = l[i](event)
  File "/home/serwy/Code/python/cpython/Lib/idlelib/CallTips.py", line 56, in try_open_calltip_event
    self.open_calltip(False)
  File "/home/serwy/Code/python/cpython/Lib/idlelib/CallTips.py", line 75, in open_calltip
    argspec = self.fetch_tip(expression)
  File "/home/serwy/Code/python/cpython/Lib/idlelib/CallTips.py", line 101, in fetch_tip
    (expression,), {})
  File "/home/serwy/Code/python/cpython/Lib/idlelib/rpc.py", line 216, in remotecall
    return self.asyncreturn(seq)
  File "/home/serwy/Code/python/cpython/Lib/idlelib/rpc.py", line 247, in asyncreturn
    return self.decoderesponse(response)
  File "/home/serwy/Code/python/cpython/Lib/idlelib/rpc.py", line 267, in decoderesponse
    raise what
Exception


The attached patch fixes the issue.

----------
components: IDLE
files: calltips_getattr_error.patch
keywords: easy, needs review, patch
messages: 177064
nosy: serwy, terry.reedy
priority: normal
severity: normal
stage: patch review
status: open
title: IDLE: Calltip fails if __getattr__ raises exception
type: behavior
versions: Python 3.2, Python 3.3, Python 3.4
Added file: http://bugs.python.org/file28231/calltips_getattr_error.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue16630>
_______________________________________


More information about the New-bugs-announce mailing list