From 97aa21b46a931cea07a37d8d8d3069bfd93a558f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20v=2E=20L=C3=B6wis?= Date: Sun, 3 Jun 2012 12:26:09 +0200 Subject: [PATCH 1/2] Do not try to insert control characters. --- Lib/idlelib/AutoCompleteWindow.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/idlelib/AutoCompleteWindow.py b/Lib/idlelib/AutoCompleteWindow.py index 04777460ee3..7787e7034c1 100644 --- a/Lib/idlelib/AutoCompleteWindow.py +++ b/Lib/idlelib/AutoCompleteWindow.py @@ -354,7 +354,7 @@ class AutoCompleteWindow: # A modifier key, so ignore return - elif event.char: + elif event.char and event.char >= ' ': # Regular character with a non-length-1 keycode self._change_start(self.start + event.char) self.lasttypedstart = self.start From 9f44a66abc476a6aa57238c005253242b45f827e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20v=2E=20L=C3=B6wis?= Date: Sun, 3 Jun 2012 12:32:42 +0200 Subject: [PATCH 2/2] PEP 3131: support non-ASCII characters in auto-completion of identifiers. --- Lib/idlelib/AutoComplete.py | 2 +- Lib/idlelib/NEWS.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Lib/idlelib/AutoComplete.py b/Lib/idlelib/AutoComplete.py index 1298d9f012e..6b5391ba790 100644 --- a/Lib/idlelib/AutoComplete.py +++ b/Lib/idlelib/AutoComplete.py @@ -143,7 +143,7 @@ class AutoComplete: elif hp.is_in_code() and (not mode or mode==COMPLETE_ATTRIBUTES): self._remove_autocomplete_window() mode = COMPLETE_ATTRIBUTES - while i and curline[i-1] in ID_CHARS: + while i and curline[i-1] in ID_CHARS or ord(curline[i-1]) > 127: i -= 1 comp_start = curline[i:j] if i and curline[i-1] == '.': diff --git a/Lib/idlelib/NEWS.txt b/Lib/idlelib/NEWS.txt index 334b0c2d97d..de9f55d2f7e 100644 --- a/Lib/idlelib/NEWS.txt +++ b/Lib/idlelib/NEWS.txt @@ -2,7 +2,7 @@ What's New in IDLE 3.2.4? ========================= - Issue #14937: Perform auto-completion of filenames in strings even for - non-ASCII filenames. + non-ASCII filenames. Likewise for identifiers. What's New in IDLE 3.2.3? =========================