Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7b2669b

Browse files
committed
Merged revisions 71995 via svnmerge from
svn+ssh://[email protected]/python/trunk ........ r71995 | kurt.kaiser | 2009-04-27 01:22:11 +0200 (Mo, 27 Apr 2009) | 2 lines Right click 'go to file/line' not working if spaces in path. Bug 5559. ........
1 parent 57e1b50 commit 7b2669b

2 files changed

Lines changed: 13 additions & 25 deletions

File tree

Lib/idlelib/NEWS.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ What's New in IDLE 2.7? (UNRELEASED, but merged into 3.1 releases above.)
3030

3131
*Release date: XX-XXX-2009*
3232

33+
- OutputWindow/PyShell right click menu "Go to file/line" wasn't working with
34+
file paths containing spaces. Bug 5559.
35+
3336
- Windows: Version string for the .chm help file changed, file not being
3437
accessed Patch 5783 Guilherme Polo
3538

Lib/idlelib/OutputWindow.py

Lines changed: 10 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ def flush(self):
5858
r'file "([^"]*)", line (\d+)',
5959
r'([^\s]+)\((\d+)\)',
6060
r'([^\s]+):\s*(\d+):',
61+
r'^\s*(\S+.*?):\s*(\d+):', # Win path with spaces, trim leading spaces
6162
]
6263

6364
file_line_progs = None
@@ -91,17 +92,17 @@ def goto_file_line(self, event=None):
9192

9293
def _file_line_helper(self, line):
9394
for prog in self.file_line_progs:
94-
m = prog.search(line)
95-
if m:
96-
break
95+
match = prog.search(line)
96+
if match:
97+
filename, lineno = match.group(1, 2)
98+
try:
99+
f = open(filename, "r")
100+
f.close()
101+
break
102+
except IOError:
103+
continue
97104
else:
98105
return None
99-
filename, lineno = m.group(1, 2)
100-
try:
101-
f = open(filename, "r")
102-
f.close()
103-
except IOError:
104-
return None
105106
try:
106107
return filename, int(lineno)
107108
except TypeError:
@@ -134,19 +135,3 @@ def setup(self):
134135
text.tag_configure(tag, **cnf)
135136
text.tag_raise('sel')
136137
self.write = self.owin.write
137-
138-
#class PseudoFile:
139-
#
140-
# def __init__(self, owin, tags, mark="end"):
141-
# self.owin = owin
142-
# self.tags = tags
143-
# self.mark = mark
144-
145-
# def write(self, s):
146-
# self.owin.write(s, self.tags, self.mark)
147-
148-
# def writelines(self, l):
149-
# map(self.write, l)
150-
151-
# def flush(self):
152-
# pass

0 commit comments

Comments
 (0)