Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 346753

Summary: dev-python/urlgrabber-3.9.1 fails with TypeError: can't multiply sequence by non-int of type 'float'
Product: Gentoo Linux Reporter: Tuukka Mäkinen <tukem+bugs.gentoo.org>
Component: [OLD] DevelopmentAssignee: Python Gentoo Team <python>
Status: RESOLVED FIXED    
Severity: normal CC: andreis.vinogradovs, djc
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 302614, 309805    

Description Tuukka Mäkinen 2010-11-25 13:51:26 UTC
While testing mic (meego-image-creator) that I'd just made an ebuild for I got an error from urlgrabber:

* About to connect() to download.meego.com port 80 (#0)
*   Trying 140.211.166.231... 2010-11-25 13:02:02,939 max_size = 34065
max_size = 34065
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/urlgrabber/grabber.py", line 1522, in _progress_update
    if self._over_max_size(cur=self._amount_read-self._reget_length):
  File "/usr/lib/python2.6/site-packages/urlgrabber/grabber.py", line 1541, in _over_max_size
    if cur > max_size + max_size*.10:
TypeError: can't multiply sequence by non-int of type 'float'
Comment 1 Tuukka Mäkinen 2010-11-25 13:56:07 UTC
Google search on the error message reveals that Debian has a patch that fixes also this issue. I didn't go through their patch carefully enough to understand what else it does.

http://patch-tracker.debian.org/package/urlgrabber/3.9.1-4

The important part for this case is in grabber_fix.diff
@@ -1532,11 +1589,14 @@
     def _over_max_size(self, cur, max_size=None):
 
         if not max_size:
-            max_size = self.size
-        if self.opts.size: # if we set an opts size use that, no matter what
-            max_size = self.opts.size
+            if not self.opts.size:
+                max_size = self.size
+            else:
+                max_size = self.opts.size
+
         if not max_size: return False # if we have None for all of the Max then this is dumb
-        if cur > max_size + max_size*.10:
+
+        if cur > int(float(max_size) * 1.10):
Comment 2 Fabian Köster 2011-01-08 10:57:15 UTC
I am also having this problem and can confirm that the Debian patch works for me.
Comment 3 Andreis Vinogradovs ( slepnoga ) 2011-04-06 14:12:01 UTC
Confirm this bug
Comment 4 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2011-04-06 14:34:28 UTC
Please test this patch:
http://yum.baseurl.org/gitweb?p=urlgrabber.git;a=commitdiff_plain;h=89cc380a2a251a1d2d8b91cf6df170fa546597aa
Comment 5 Maxim Koltsov (RETIRED) gentoo-dev 2011-04-06 16:56:35 UTC
(In reply to comment #4)
> Please test this patch:
> http://yum.baseurl.org/gitweb?p=urlgrabber.git;a=commitdiff_plain;h=89cc380a2a251a1d2d8b91cf6df170fa546597aa

I managed to construct suitable patch from this and debian's one. If no complains, i commit it in half an our.
Comment 6 Maxim Koltsov (RETIRED) gentoo-dev 2011-04-06 18:01:45 UTC
Fixed in tree now

*urlgrabber-3.9.1-r1 (06 Apr 2011)

  06 Apr 2011; Maxim (maksbotan) <kolmax94@gmail.com>
  +urlgrabber-3.9.1-r1.ebuild, +files/urlgrabber-3.9.1.patch:
  Revision bump, imported upstream patch. Fixes bug #346753