diff -r 506a07ea1173 Lib/trace.py --- a/Lib/trace.py Fri Oct 25 22:33:52 2013 -0500 +++ b/Lib/trace.py Sat Oct 26 12:44:50 2013 +0800 @@ -198,7 +198,7 @@ comparepath = os.path.normcase(path) longest = "" for dir in sys.path: - dir = os.path.normcase(dir) + dir = os.path.normcase(dir.rstrip('/')) if comparepath.startswith(dir) and comparepath[len(dir)] == os.sep: if len(dir) > len(longest): longest = dir