From: Georg Brandl Date: Mon, 14 Aug 2006 21:55:28 +0000 (+0000) Subject: Patch #1536071: trace.py should now find the full module name of a X-Git-Tag: v2.5c1~33 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7a1af770b9fbf73e967fac9ad224e6caad62e4cc;p=python Patch #1536071: trace.py should now find the full module name of a file correctly even on Windows. --- diff --git a/Lib/trace.py b/Lib/trace.py index db36e1d21d..35edac2eea 100644 --- a/Lib/trace.py +++ b/Lib/trace.py @@ -179,9 +179,11 @@ def fullmodname(path): # looking in sys.path for the longest matching prefix. We'll # assume that the rest is the package name. + comparepath = os.path.normcase(path) longest = "" for dir in sys.path: - if path.startswith(dir) and path[len(dir)] == os.path.sep: + dir = os.path.normcase(dir) + if comparepath.startswith(dir) and comparepath[len(dir)] == os.sep: if len(dir) > len(longest): longest = dir diff --git a/Misc/NEWS b/Misc/NEWS index 06dde4aeec..7e945604eb 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -64,6 +64,9 @@ Core and builtins Library ------- +- Patch #1536071: trace.py should now find the full module name of a + file correctly even on Windows. + - logging's atexit hook now runs even if the rest of the module has already been cleaned up.