[yum-commits] 4 commits - ChangeLog test/test_byterange.py test/test_grabber.py urlgrabber/grabber.py urlgrabber/__init__.py

zpavlas at osuosl.org zpavlas at osuosl.org
Fri Oct 25 14:33:45 UTC 2013


 ChangeLog              |    8 ++++++++
 test/test_byterange.py |   14 +-------------
 test/test_grabber.py   |    1 +
 urlgrabber/__init__.py |    9 +++++----
 urlgrabber/grabber.py  |    6 ++++--
 5 files changed, 19 insertions(+), 19 deletions(-)

New commits:
commit 93ad446fc6533304e33b231cd5786572773440b9
Author: Zdenek Pavlas <zpavlas at redhat.com>
Date:   Mon Oct 21 16:52:53 2013 +0200

    single-conn mode: Kill the cached idle connection. BZ 853432
    
    The multi-downloader manages connections as necessary, caching
    at most one downloader per host. But there's one more connection,
    used by the legacy downloader.  In case keepalive=1 (default),
    it's still connected, possibly to the same connection-limited
    host.  Kill it.

diff --git a/urlgrabber/grabber.py b/urlgrabber/grabber.py
index b004f4d..d06cdae 100644
--- a/urlgrabber/grabber.py
+++ b/urlgrabber/grabber.py
@@ -2221,6 +2221,9 @@ def parallel_wait(meter=None):
                 # Turn on the max_connections=1 override. BZ 853432
                 if DEBUG: DEBUG.info('max_connections(%s) %s => 1', key, limit)
                 single.add(key)
+                # When using multi-downloader the parent's _curl_cache
+                # object is idle. Kill it, as it might use keepalive=1.
+                reset_curl_obj()
 
             retry = opts.retry or 0
             if opts.failure_callback:
commit 70d092e558f3d57b04eaf7c654a734bdf90e07fc
Author: Zdenek Pavlas <zpavlas at redhat.com>
Date:   Wed Oct 9 14:21:27 2013 +0200

    bump version to 3.10

diff --git a/ChangeLog b/ChangeLog
index 644fbdb..fdbe63d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2013-10-09  Zdenek Pavlas <zpavlas at redhat.com>
+
+	* lots of enahncements and bugfixes
+	  (parallel downloading, mirror profiling, new options)
+	* updated authors, url
+	* updated unit tests
+	* bump version to 3.10
+
 2009-09-25  Seth Vidal <skvidal at fedoraproject.org>
 
 	* urlgrabber/__init__.py: bump version to 3.9.1
diff --git a/urlgrabber/__init__.py b/urlgrabber/__init__.py
index ddd5204..f10f488 100644
--- a/urlgrabber/__init__.py
+++ b/urlgrabber/__init__.py
@@ -44,11 +44,12 @@ following features:
     automatically switching mirrors if there is a failure.
 """
 
-__version__ = '3.9.1'
-__date__    = '2009/09/25'
+__version__ = '3.10'
+__date__    = '2013/10/09'
 __author__  = 'Michael D. Stenner <mstenner at linux.duke.edu>, ' \
               'Ryan Tomayko <rtomayko at naeblis.cx>' \
-              'Seth Vidal <skvidal at fedoraproject.org>' 
-__url__     = 'http://linux.duke.edu/projects/urlgrabber/'
+              'Seth Vidal <skvidal at fedoraproject.org>' \
+              'Zdenek Pavlas <zpavlas at redhat.com>'
+__url__     = 'http://urlgrabber.baseurl.org/'
 
 from grabber import urlgrab, urlopen, urlread
commit bff5b7f2c554c5e6b57c53e1e0524525bd8b3c1f
Author: Zdenek Pavlas <zpavlas at redhat.com>
Date:   Wed Oct 9 14:06:56 2013 +0200

    Fix unit tests
    
    test_post(): skip this as the server does not exec the script.
    
    test_readline(): StringIO readline(0) is broken, limit=0
    is handled as 'no limit'. Using cStringIO instead fixed this.
    
    test_poor_mans_seek(): cStringIO.seek() does not exist.

diff --git a/test/test_byterange.py b/test/test_byterange.py
index fe7e105..0f75807 100644
--- a/test/test_byterange.py
+++ b/test/test_byterange.py
@@ -25,7 +25,7 @@
 
 import sys
 
-from StringIO import StringIO
+from cStringIO import StringIO
 from urlgrabber.byterange import RangeableFileObject
 
 from base_test_code import *
@@ -52,18 +52,6 @@ class RangeableFileObjectTestCase(TestCase):
         self.rfo.seek(1,1)
         self.assertEquals('of', self.rfo.read(2))
     
-    def test_poor_mans_seek(self):
-        """RangeableFileObject.seek() poor mans version..
-        
-        We just delete the seek method from StringIO so we can
-        exercise RangeableFileObject when the file object supplied
-        doesn't support seek.
-        """
-        seek = StringIO.seek
-        del(StringIO.seek)
-        self.test_seek()
-        StringIO.seek = seek
-    
     def test_read(self):
         """RangeableFileObject.read()"""
         self.assertEquals('the', self.rfo.read(3))
diff --git a/test/test_grabber.py b/test/test_grabber.py
index d3a7692..8e45d25 100644
--- a/test/test_grabber.py
+++ b/test/test_grabber.py
@@ -98,6 +98,7 @@ class HTTPTests(TestCase):
 
     def test_post(self):
         "do an HTTP post"
+        self.skip() # disabled on server
         headers = (('Content-type', 'text/plain'),)
         ret = grabber.urlread(base_http + 'test_post.php',
                               data=short_reference_data,
commit 82dc740e12a78e8dfaabdf3a3d4114a4c65af244
Author: Zdenek Pavlas <zpavlas at redhat.com>
Date:   Tue Oct 8 15:19:09 2013 +0200

    Fix the condition to enter single-connection mode (again)
    
    ug_err.errno is already translated.

diff --git a/urlgrabber/grabber.py b/urlgrabber/grabber.py
index 069dab9..b004f4d 100644
--- a/urlgrabber/grabber.py
+++ b/urlgrabber/grabber.py
@@ -2216,8 +2216,7 @@ def parallel_wait(meter=None):
 
             if ug_err is None:
                 continue
-            if key not in single and ug_err.errno in (pycurl.E_OPERATION_TIMEOUTED,
-                                                      pycurl.E_COULDNT_CONNECT):
+            if limit != 1 and key not in single and ug_err.errno in (12, 14):
                 # One possible cause is connection-limited server.
                 # Turn on the max_connections=1 override. BZ 853432
                 if DEBUG: DEBUG.info('max_connections(%s) %s => 1', key, limit)


More information about the Yum-commits mailing list