From: Vinay Sajip Date: Thu, 8 Jul 2004 10:22:35 +0000 (+0000) Subject: FileHandler now stores the basename as an absolute path (fix for SF #982049) X-Git-Tag: v2.4a1~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4bbab2bde4fa7df27d9b9f04793d53d4754e22b4;p=thirdparty%2FPython%2Fcpython.git FileHandler now stores the basename as an absolute path (fix for SF #982049) --- diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py index cf4d78227970..e9bcf33ec478 100644 --- a/Lib/logging/__init__.py +++ b/Lib/logging/__init__.py @@ -37,7 +37,7 @@ except ImportError: __author__ = "Vinay Sajip " __status__ = "beta" __version__ = "0.4.9.3" -__date__ = "03 July 2004" +__date__ = "08 July 2004" #--------------------------------------------------------------------------- # Miscellaneous module data @@ -709,7 +709,9 @@ class FileHandler(StreamHandler): Open the specified file and use it as the stream for logging. """ StreamHandler.__init__(self, open(filename, mode)) - self.baseFilename = filename + #keep the absolute path, otherwise derived classes which use this + #may come a cropper when the current directory changes + self.baseFilename = os.path.abspath(filename) self.mode = mode def close(self):