diff options
author | jortel <devnull@localhost> | 2010-04-09 12:56:47 +0000 |
---|---|---|
committer | jortel <devnull@localhost> | 2010-04-09 12:56:47 +0000 |
commit | 25c156e1a13c85ed29ccf079c833957fd988336e (patch) | |
tree | de28bc4e64aed659d5140608c830619131f5e8c5 | |
parent | 51757ebeda57aad373db3168e04636acc7d44955 (diff) | |
download | suds-25c156e1a13c85ed29ccf079c833957fd988336e.tar.gz |
FileCache.putf() needs to return valid file pointer although putf() not being used in suds it should do the right thing.
-rw-r--r-- | suds/cache.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/suds/cache.py b/suds/cache.py index 8fa9b21..a3a53cd 100644 --- a/suds/cache.py +++ b/suds/cache.py @@ -203,8 +203,9 @@ class FileCache(Cache): fn = self.__fn(id) f = self.open(fn, 'w') f.write(fp.read()) + fp.close() f.close() - return fp + return open(fn) except: log.debug(id, exc_info=1) return fp @@ -235,7 +236,7 @@ class FileCache(Cache): if self.duration[1] < 1: return created = dt.fromtimestamp(os.path.getctime(fn)) - d = {self.duration[0] : self.duration[1]} + d = { self.duration[0]:self.duration[1] } expired = created+timedelta(**d) if expired < dt.now(): log.debug('%s expired, deleted', fn) |