From: smallcode <14190635@qq.com> Date: Tue, 22 Oct 2013 09:41:56 +0000 (+0800) Subject: Update filesystem.py X-Git-Tag: v0.3.4~1 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=16fbe40d878e84086e254c00297712e8e0a218cb;p=vcrpy.git Update filesystem.py fix WindowsError: [Error 32]. because must close the file before rename the file in window system. --- diff --git a/vcr/persisters/filesystem.py b/vcr/persisters/filesystem.py index ecbd9b7..6a1a275 100644 --- a/vcr/persisters/filesystem.py +++ b/vcr/persisters/filesystem.py @@ -13,7 +13,7 @@ class FilesystemPersister(object): fd, name = tempfile.mkstemp(dir=dirname, prefix=filename) with os.fdopen(fd, 'w') as fout: fout.write(contents) - os.rename(name, path) + os.rename(name, path) @classmethod def write(cls, cassette_path, data):