]> granicus.if.org Git - python/commitdiff
Further development of issue5559, handle Windows files
authorKurt B. Kaiser <kbk@shore.net>
Sun, 3 May 2009 02:05:22 +0000 (02:05 +0000)
committerKurt B. Kaiser <kbk@shore.net>
Sun, 3 May 2009 02:05:22 +0000 (02:05 +0000)
which not only have embedded spaces, but leading spaces.

Lib/idlelib/OutputWindow.py

index a243a2d9768dd9f2ad14f29622fcbf562a5587d8..f6b379b9a6a69154c898b80c7be237a979a363da 100644 (file)
@@ -60,10 +60,12 @@ class OutputWindow(EditorWindow):
     ]
 
     file_line_pats = [
+        # order of patterns matters
         r'file "([^"]*)", line (\d+)',
         r'([^\s]+)\((\d+)\)',
-        r'([^\s]+):\s*(\d+):',
-        r'^\s*(\S+.*?):\s*(\d+):',  # Win path with spaces, trim leading spaces
+        r'^(\s*\S.*?):\s*(\d+):',  # Win filename, maybe starting with spaces
+        r'([^\s]+):\s*(\d+):',     # filename or path, ltrim
+        r'^\s*(\S.*?):\s*(\d+):',  # Win abs path with embedded spaces, ltrim
     ]
 
     file_line_progs = None