Index: Lib/idlelib/EditorWindow.py =================================================================== --- Lib/idlelib/EditorWindow.py (revision 74581) +++ Lib/idlelib/EditorWindow.py (working copy) @@ -17,6 +17,10 @@ from configHandler import idleConf import aboutDialog, textView, configDialog import macosxSupport +try: + import _winreg +except ImportError: + _winreg = None # The default tab setting for a Text widget, in average-width characters. TK_TABWIDTH_DEFAULT = 8 @@ -600,6 +604,11 @@ base, ext = os.path.splitext(os.path.basename(filename)) if os.path.normcase(ext) in (".py", ".pyw"): return True + if _winreg: + with _winreg.OpenKey(_winreg.HKEY_CLASSES_ROOT, ext) as key: + ftype = _winreg.QueryValueEx(key, None)[0] + if ftype.lower() in ('python.file','python.noconfile'): + return True try: f = open(filename) line = f.readline()