[issue2220] bug in rlcompleter

Lorenz Quack report at bugs.python.org
Mon Mar 3 15:01:34 CET 2008


Lorenz Quack added the comment:

Some more information:
the dot in the example causes complete() to call self.attr_matches(text)
which in turn performes the following call
re.match(r"(\w+(\.\w+)*)\.(\w*)", text)
and return None if there is no match.
the complete method unconditionally accesses the return value like a
list via
matches[state]
which raises the TypeError.
The obvious solution was to return an empty list instead of None which
is also the behaviour in all other cases where no completion is found.

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue2220>
__________________________________


More information about the Python-bugs-list mailing list