Commit 94290d39 authored by Kurt B. Kaiser's avatar Kurt B. Kaiser

Right click 'go to file/line' not working if spaces

in path.  Bug 5559.
parent 4b965f6a
...@@ -3,6 +3,9 @@ What's New in IDLE 2.7a0? ...@@ -3,6 +3,9 @@ What's New in IDLE 2.7a0?
*Release date: XX-XXX-2009* *Release date: XX-XXX-2009*
- OutputWindow/PyShell right click menu "Go to file/line" wasn't working with
file paths containing spaces. Bug 5559.
- Windows: Version string for the .chm help file changed, file not being - Windows: Version string for the .chm help file changed, file not being
accessed Patch 5783 Guilherme Polo accessed Patch 5783 Guilherme Polo
......
...@@ -63,6 +63,7 @@ class OutputWindow(EditorWindow): ...@@ -63,6 +63,7 @@ class OutputWindow(EditorWindow):
r'file "([^"]*)", line (\d+)', r'file "([^"]*)", line (\d+)',
r'([^\s]+)\((\d+)\)', r'([^\s]+)\((\d+)\)',
r'([^\s]+):\s*(\d+):', r'([^\s]+):\s*(\d+):',
r'^\s*(\S+.*?):\s*(\d+):', # Win path with spaces, trim leading spaces
] ]
file_line_progs = None file_line_progs = None
...@@ -96,17 +97,17 @@ class OutputWindow(EditorWindow): ...@@ -96,17 +97,17 @@ class OutputWindow(EditorWindow):
def _file_line_helper(self, line): def _file_line_helper(self, line):
for prog in self.file_line_progs: for prog in self.file_line_progs:
m = prog.search(line) match = prog.search(line)
if m: if match:
break filename, lineno = match.group(1, 2)
try:
f = open(filename, "r")
f.close()
break
except IOError:
continue
else: else:
return None return None
filename, lineno = m.group(1, 2)
try:
f = open(filename, "r")
f.close()
except IOError:
return None
try: try:
return filename, int(lineno) return filename, int(lineno)
except TypeError: except TypeError:
...@@ -139,19 +140,3 @@ class OnDemandOutputWindow: ...@@ -139,19 +140,3 @@ class OnDemandOutputWindow:
text.tag_configure(tag, **cnf) text.tag_configure(tag, **cnf)
text.tag_raise('sel') text.tag_raise('sel')
self.write = self.owin.write self.write = self.owin.write
#class PseudoFile:
#
# def __init__(self, owin, tags, mark="end"):
# self.owin = owin
# self.tags = tags
# self.mark = mark
# def write(self, s):
# self.owin.write(s, self.tags, self.mark)
# def writelines(self, l):
# map(self.write, l)
# def flush(self):
# pass
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment