Menu

#398 Dangerous autocompletes

open
nobody
pythonwin (177)
5
2008-12-29
2008-12-29
No

I'm using pywin32 build 210. Some autocompletes are dangerous (and should be trapped in my opinion).

Try typing the following in Pythonwin:

# Maybe we should use raw_input().
f = input()

When you type the "." character in the comment, Pythonwin evaluates raw_input() in order to fetch its attributes, and pops up an input prompt.

Well, OK, not a huge problem. We can just cancel the prompt.

Now try this one:

# Maybe we should use os._exit(0).
sys.exit(0)

Pythonwin crashes hard. Obviously it's a dynamic language and you can't protect everyone from everything, but maybe these two could be trapped by the autocompleter and not evaluated.

Discussion

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.