]> granicus.if.org Git - python/commitdiff
Issue21709: Call os.path.normcase when setting _srcfile for compatibility
authorGregory P. Smith <greg@krypto.org>
Thu, 22 Oct 2015 20:12:20 +0000 (13:12 -0700)
committerGregory P. Smith <greg@krypto.org>
Thu, 22 Oct 2015 20:12:20 +0000 (13:12 -0700)
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

index 2c0f14f5b0e9d0e18f189fb66be7be1c66328708..fa9ebe8bf23ac02b0aadd31f6e17e0048cb205b5 100644 (file)
@@ -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