Repository navigation
Fix crash when using getargspec with xmlrpclib #202
Copy link
Copy link
Closed
Labels
Description
Attached diff fix a crash when bpython tries to retrieve the arguments of a function provided by python's xmlrpclib module:
>>> import xmlrpclib
>>> api = xmlrpclib.Server("http://localhost")
>>> api.login
Then I hit '(' and get :
Traceback (most recent call last):
File "/usr/local/bin/bpython", line 8, in <module>
load_entry_point('bpython==0.10.1', 'console_scripts', 'bpython')()
File "/usr/local/lib/python2.7/site-packages/bpython/cli.py", line 1756, in
main
banner=banner)
File "/usr/local/lib/python2.7/site-packages/bpython/cli.py", line 1658, in
curses_wrapper
return func(stdscr, *args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/bpython/cli.py", line 1727, in
main_curses
clirepl.repl()
File "/usr/local/lib/python2.7/site-packages/bpython/cli.py", line 1015, in
repl
inp = self.get_line()
File "/usr/local/lib/python2.7/site-packages/bpython/cli.py", line 600, in g
et_line
if self.p_key(key) is None:
File "/usr/local/lib/python2.7/site-packages/bpython/cli.py", line 911, in p
_key
self.addstr(key)
File "/usr/local/lib/python2.7/site-packages/bpython/cli.py", line 290, in a
ddstr
self.complete()
File "/usr/local/lib/python2.7/site-packages/bpython/cli.py", line 383, in $
omplete
self.list_win_visible = repl.Repl.complete(self, tab)
File "/usr/local/lib/python2.7/site-packages/bpython/repl.py", line 540, in
complete
if not self.get_args():
File "/usr/local/lib/python2.7/site-packages/bpython/repl.py", line 511, in
get_args
self.argspec = inspection.getargspec(func, f)
File "/usr/local/lib/python2.7/site-packages/bpython/inspection.py", line 23
2, in getargspec
or (func_name == '__init__'))
File "/usr/local/lib/python2.7/xmlrpclib.py", line 1224, in __call__
return self.__send(self.__name, args)
File "/usr/local/lib/python2.7/xmlrpclib.py", line 1570, in __request
verbose=self.__verbose
File "/usr/local/lib/python2.7/xmlrpclib.py", line 1264, in request
return self.single_request(host, handler, request_body, verbose)
File "/usr/local/lib/python2.7/xmlrpclib.py", line 1297, in single_request
return self.parse_response(response)
File "/usr/local/lib/python2.7/xmlrpclib.py", line 1468, in parse_response
return u.close()
File "/usr/local/lib/python2.7/xmlrpclib.py", line 793, in close
raise Fault(**self._stack[0])
xmlrpclib.Fault: <Fault 1: 'Method "login.__name__.__eq__" is not supported'>
I'm using bpython 0.10.1 with Python 2.7.1 on OpenBSD
- Bitbucket: https://bitbucket.org/bobf/bpython/issue/202
- Originally Reported By:
- Originally Created At: 2011-10-10T15:08:28.468
Activity
ikanobori commentedon Jul 4, 2014
Fixed in [[https://bitbucket.org/bobf/bpython/changeset/e437bee0b1b2|e437bee0b1b2]].
Original Comment By: Sebastian Ramacher
ikanobori commentedon Jul 4, 2014
The attached patch fixes the issue but also disables getargspec for almost any other object. That's definitly not what we want. I'll try to come up with a patch that fixes the issue.
Original Comment By: Sebastian Ramacher