devel/python-urlgrabber urlgrabber-string-type.patch, NONE, 1.1 python-urlgrabber.spec, 1.21, 1.22

Jeremy Katz (katzj) fedora-extras-commits at redhat.com
Wed Oct 10 15:39:52 UTC 2007


Author: katzj

Update of /cvs/pkgs/devel/python-urlgrabber
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv17665

Modified Files:
	python-urlgrabber.spec 
Added Files:
	urlgrabber-string-type.patch 
Log Message:
* Wed Oct 10 2007 Jeremy Katz <katzj at redhat.com> - 3.0.0-3
- fix type checking of strings to also include unicode strings; fixes 
  regets from yum (#235618)


urlgrabber-string-type.patch:

--- NEW FILE urlgrabber-string-type.patch ---
diff -up urlgrabber-3.0.0/urlgrabber/progress.py.type urlgrabber-3.0.0/urlgrabber/progress.py
--- urlgrabber-3.0.0/urlgrabber/progress.py.type	2007-10-10 11:34:55.000000000 -0400
+++ urlgrabber-3.0.0/urlgrabber/progress.py	2007-10-10 11:36:50.000000000 -0400
@@ -23,6 +23,7 @@ import sys
 import time
 import math
 import thread
+import types
     
 class BaseMeter:
     def __init__(self):
@@ -343,7 +344,7 @@ class TextMultiFileMeter(MultiFileMeter)
         try:
             format = "%-30.30s %6.6s %s"
             fn = meter.basename
-            if type(message) in (type(''), type(u'')):
+            if type(message) in types.StringTypes:
                 message = message.splitlines()
             if not message: message = ['']
             out = '%-79s' % (format % (fn, 'FAILED', message[0] or ''))
diff -up urlgrabber-3.0.0/urlgrabber/mirror.py.type urlgrabber-3.0.0/urlgrabber/mirror.py
--- urlgrabber-3.0.0/urlgrabber/mirror.py.type	2007-10-10 11:35:22.000000000 -0400
+++ urlgrabber-3.0.0/urlgrabber/mirror.py	2007-10-10 11:36:14.000000000 -0400
@@ -90,6 +90,7 @@ CUSTOMIZATION
 
 import random
 import thread  # needed for locking to make this threadsafe
+import types
 
 from grabber import URLGrabError, CallbackObject, DEBUG
 
@@ -266,7 +267,7 @@ class MirrorGroup:
     def _parse_mirrors(self, mirrors):
         parsed_mirrors = []
         for m in mirrors:
-            if type(m) == type(''): m = {'mirror': m}
+            if type(m) in types.StringTypes: m = {'mirror': m}
             parsed_mirrors.append(m)
         return parsed_mirrors
     
diff -up urlgrabber-3.0.0/urlgrabber/grabber.py.type urlgrabber-3.0.0/urlgrabber/grabber.py
--- urlgrabber-3.0.0/urlgrabber/grabber.py.type	2007-10-10 11:34:50.000000000 -0400
+++ urlgrabber-3.0.0/urlgrabber/grabber.py	2007-10-10 11:35:51.000000000 -0400
@@ -372,6 +372,7 @@ import sys
 import urlparse
 import rfc822
 import time
+import types
 import string
 import urllib
 import urllib2
@@ -1128,7 +1129,7 @@ class URLGrabberFileObject:
         self.append = 0
         reget_length = 0
         rt = None
-        if have_range and self.opts.reget and type(self.filename) == type(''):
+        if have_range and self.opts.reget and type(self.filename) in types.StringTypes:
             # we have reget turned on and we're dumping to a file
             try:
                 s = os.stat(self.filename)


Index: python-urlgrabber.spec
===================================================================
RCS file: /cvs/pkgs/devel/python-urlgrabber/python-urlgrabber.spec,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- python-urlgrabber.spec	27 Aug 2007 15:24:16 -0000	1.21
+++ python-urlgrabber.spec	10 Oct 2007 15:39:20 -0000	1.22
@@ -3,9 +3,10 @@
 Summary: A high-level cross-protocol url-grabber
 Name: python-urlgrabber
 Version: 3.0.0
-Release: 2%{?dist}
+Release: 3%{?dist}
 Source0: urlgrabber-%{version}.tar.gz
 Patch0: urlgrabber-keepalive.patch
+Patch1: urlgrabber-string-type.patch
 License: LGPLv2+
 Group: Development/Libraries
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
@@ -22,6 +23,7 @@
 %prep
 %setup -q -n urlgrabber-%{version}
 %patch0 -p0
+%patch1 -p1
 
 %build
 python setup.py build
@@ -41,6 +43,10 @@
 %{_bindir}/urlgrabber
 
 %changelog
+* Wed Oct 10 2007 Jeremy Katz <katzj at redhat.com> - 3.0.0-3
+- fix type checking of strings to also include unicode strings; fixes 
+  regets from yum (#235618)
+
 * Mon Aug 27 2007 Jeremy Katz <katzj at redhat.com> - 3.0.0-2
 - fixes for package review (#226347)
 




More information about the fedora-extras-commits mailing list