bobf is sharing code with you

Bitbucket is a code hosting site. Unlimited public and private repositories. Free for small teams.

Don't show this again

bobf / bpython http://bpython-interpreter.org/

Fancy curses interface to the Python interpreter

Clone this repository (size: 838.8 KB): HTTPS / SSH
hg clone https://bitbucket.org/bobf/bpython
hg clone ssh://hg@bitbucket.org/bobf/bpython

Issues

#202 Fix crash when using getargspec with xmlrpclib

Reported by mpieuchot

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

Status: resolved Responsible: Sebastian Ramacher Type: bug Priority: major
Milestone: none Component: none Version: none

Attachments

Comments and changes

  1. #1 Sebastian Ramacher

    written

    • Changed responsible from nobody to sebastinas.
    • Changed status from new to open.

    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.

  2. #2 Sebastian Ramacher

    written

    • Changed status from open to resolved.

    Fixed in e437bee0b1b2.

Add comment / attachment

Verification: Please write the text from the image in the box (letters only)

captcha

Is that you, Humanoid? Is this me?