From 2022548baf059473d629a7f8be7b9fd7c2ab92b7 2006-11-21 19:44:11 From: vivainio Date: 2006-11-21 19:44:11 Subject: [PATCH] file completer used os.path.join instead of literal /, breaking windows. Now uses / --- diff --git a/IPython/completer.py b/IPython/completer.py index 96bee03..a9bace2 100644 --- a/IPython/completer.py +++ b/IPython/completer.py @@ -409,10 +409,13 @@ class IPCompleter(Completer): if len(matches) == 1 and os.path.isdir(matches[0]): # Takes care of links to directories also. Use '/' # explicitly, even under Windows, so that name completions - # don't end up escaped. - pjoin = os.path.join + # don't end up escaped. d = matches[0] - matches = [ pjoin(d,p) for p in os.listdir(d) ] + if d[-1] in ['/','\\']: + d = d[:-1] + + matches = [ (d + '/' + p) for p in os.listdir(d) ] + return matches def alias_matches(self, text):