From 1fa9f7990b16565836294899c4dc3852bd002072 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Sun, 5 Oct 2003 20:40:34 +0000 Subject: [PATCH] Changes to be nice to Windows. --- src/plugins.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/plugins.py b/src/plugins.py index 8d9bf1923..2effcdd39 100644 --- a/src/plugins.py +++ b/src/plugins.py @@ -148,7 +148,11 @@ class PeriodicFileDownloader(object): self.downloadedCounter[filename] += 1 self.lastDownloaded[filename] = time.time() if f is None: - os.rename(newFilename, os.path.join(conf.dataDir, filename)) + toFilename = os.path.join(conf.dataDir, filename) + if os.name == 'nt': + # Windows, grrr... + os.remove(toFilename) + os.rename(newFilename, toFilename) else: start = time.time() f(newFilename)