[issue2250] rlcompleter raises Exception on bad input

Lorenz Quack report at bugs.python.org
Wed Mar 26 14:35:07 CET 2008


Lorenz Quack <don at amberfisharts.com> added the comment:

I was thinking that the code in question could maybe also raise other
exceptions. too bad I´m on vacation and can´t try this out myself.
I believe the regular expression also matches something like 

import rlcompleter
rlcompleter.Completer().complete("1foo.2bar3.smth", 0)

which I guess would result in a SyntaxError. 
would be nice if someone could verify that.

If I´m right I see two possibilities. either change the regular
expression to match only valid python identifieres or also catch
SyntaxErrors.

could there be any other exception? ("In the face of ambiguity, refuse
the temptation to guess.")

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


More information about the Python-bugs-list mailing list