[yum-commits] 2 commits - test/base_test_code.py urlgrabber/grabber.py

skvidal at osuosl.org skvidal at osuosl.org
Thu Nov 19 22:08:46 UTC 2009


 test/base_test_code.py |    2 +-
 urlgrabber/grabber.py  |   18 ++++++++++++++++--
 2 files changed, 17 insertions(+), 3 deletions(-)

New commits:
commit e86d27a4a7a72a8832ad4e1e63996ed8ac616621
Author: Seth Vidal <skvidal at fedoraproject.org>
Date:   Thu Nov 19 17:05:15 2009 -0500

    - catch errors for when the file moves before we set the timestamp
    - catch errors when we reopen if the file is gone

diff --git a/urlgrabber/grabber.py b/urlgrabber/grabber.py
index a26880c..0023fed 100644
--- a/urlgrabber/grabber.py
+++ b/urlgrabber/grabber.py
@@ -1480,9 +1480,23 @@ class PyCurlFileObject():
             # set the time
             mod_time = self.curl_obj.getinfo(pycurl.INFO_FILETIME)
             if mod_time != -1:
-                os.utime(self.filename, (mod_time, mod_time))
+                try:
+                    os.utime(self.filename, (mod_time, mod_time))
+                except OSError, e:
+                    err = URLGrabError(16, _(\
+                      'error setting timestamp on file %s from %s, OSError: %s') 
+                              % (self.filenameself.url, e))
+                    err.url = self.url
+                    raise err
             # re open it
-            self.fo = open(self.filename, 'r')
+            try:
+                self.fo = open(self.filename, 'r')
+            except IOError, e:
+                err = URLGrabError(16, _(\
+                  'error opening file from %s, IOError: %s') % (self.url, e))
+                err.url = self.url
+                raise err
+                
         else:
             #self.fo = open(self._temp_name, 'r')
             self.fo.seek(0)
commit 3374892cc76b71b509e7f29bc2d9d5830fa43c48
Author: Seth Vidal <skvidal at fedoraproject.org>
Date:   Thu Nov 19 16:34:47 2009 -0500

    point to a new url for the tests
    still doesn't fix the http post test.

diff --git a/test/base_test_code.py b/test/base_test_code.py
index 50c6348..5fb43f9 100644
--- a/test/base_test_code.py
+++ b/test/base_test_code.py
@@ -1,6 +1,6 @@
 from munittest import *
 
-base_http = 'http://www.linux.duke.edu/projects/urlgrabber/test/'
+base_http = 'http://urlgrabber.baseurl.org/test/'
 base_ftp  = 'ftp://localhost/test/'
 
 # set to a proftp server only. we're working around a couple of


More information about the Yum-commits mailing list