From 64707923bef2f539c12446b880f715a70ed6c21a Mon Sep 17 00:00:00 2001 From: "Gregory P. Smith" Date: Thu, 22 Oct 2015 13:12:20 -0700 Subject: [PATCH] Issue21709: Call os.path.normcase when setting _srcfile for compatibility with what findCaller() does when running on non-POSIX platforms. (alternatively: the normcase calls in both places could be eliminated, but that touches more code and that refactoring hasn't even been done in 3 yet...) --- Lib/logging/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py index 2c0f14f5b0e9..fa9ebe8bf23a 100644 --- a/Lib/logging/__init__.py +++ b/Lib/logging/__init__.py @@ -74,7 +74,7 @@ if hasattr(sys, '_getframe'): currentframe = lambda: sys._getframe(3) # _srcfile is used when walking the stack to check when we've got the first # caller stack frame. # -_srcfile = currentframe.__code__.co_filename +_srcfile = os.path.normcase(currentframe.__code__.co_filename) # _srcfile is only used in conjunction with sys._getframe(). # To provide compatibility with older versions of Python, set _srcfile -- 2.47.3