Skip to content

bpython crashs on large dicts as default parameter #41

Closed
@ikanobori

Description

@ikanobori

when bpython tries to autocomplete function arguments and a default value for an argument is a very large dictionary, bpython crashs with "error: addstr() returned ERR" (curses, too long line?).
http://paste.pocoo.org/show/124117/

i just found one case where this happens:

import cgi;
cgi.parse( <CRASH>

this function uses //os.environ// as a default value for an argument, which is //probably// very long.
in the help pages the dict is elided ("..." in the middle of the repr):

parse(fp=None, environ={'XAUTHORITY': '/home/user/.Xauthority', 'GLADE_...*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:'}, keep_blank_values=0, strict_parsing=0)

in the source code (/usr/lib/python2.6/cgi.py) it looks like this:

def parse(fp=None, environ=os.environ, keep_blank_values=0, strict_parsing=0)

(happens with latest version from bitbucket)


Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions