From 206e14fcf4c71d12598ccaf266759f4d2e987c06 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Wed, 8 Oct 2003 14:15:05 +0000 Subject: [PATCH] Oops, didn't check to see if the file was there before stat'ing it. --- src/plugins.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/plugins.py b/src/plugins.py index 60f3acb6c..63f0f1b4a 100644 --- a/src/plugins.py +++ b/src/plugins.py @@ -133,8 +133,11 @@ class PeriodicFileDownloader(object): self.downloadedCounter = {} for filename in self.periodicFiles: if self.periodicFiles[filename][-1] is None: - fullPathname = os.path.join(conf.dataDir, filename) - self.lastDownloaded[filename] = os.stat(fullPathname).st_ctime + fullname = os.path.join(conf.dataDir, filename) + if os.path.exists(fullname): + self.lastDownloaded[filename] = os.stat(fullname).st_ctime + else: + self.lastDownloaded[filename] = 0 else: self.lastDownloaded[filename] = 0 self.currentlyDownloading = sets.Set() @@ -143,7 +146,7 @@ class PeriodicFileDownloader(object): def _downloadFile(self, filename, url, f): infd = urllib2.urlopen(url) - newFilename = utils.mktemp() + newFilename = os.path.join(conf.dataDir, utils.mktemp()) outfd = file(newFilename, 'wb') start = time.time() s = infd.read(4096)