From: Guido van Rossum Date: Tue, 1 Jun 1999 18:55:36 +0000 (+0000) Subject: In class TemporaryFileWrapper, don't cache attributes of tpye int -- X-Git-Tag: v1.6a1~1305 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6b708d569c7e0768522e6f15e3a2ca5f5c42ab6b;p=thirdparty%2FPython%2Fcpython.git In class TemporaryFileWrapper, don't cache attributes of tpye int -- these happen to be 'closed' and 'softspace', which may change! Noted by Dave Ascher (with slightly different solution). --- diff --git a/Lib/tempfile.py b/Lib/tempfile.py index 1f301262db83..68cc896cb87d 100644 --- a/Lib/tempfile.py +++ b/Lib/tempfile.py @@ -120,7 +120,8 @@ class TemporaryFileWrapper: def __getattr__(self, name): file = self.__dict__['file'] a = getattr(file, name) - setattr(self, name, a) + if type(a) != type(0): + setattr(self, name, a) return a