diff --git a/fix-stringio.patch b/fix-stringio.patch new file mode 100644 index 0000000..cbb1e96 --- /dev/null +++ b/fix-stringio.patch @@ -0,0 +1,31 @@ +From 62f94b534289b7ab0bda879962bf6efb124a9930 Mon Sep 17 00:00:00 2001 +From: Tomas Radej +Date: Tue, 2 Sep 2014 12:52:50 +0200 +Subject: [PATCH] StringIO patch + +--- + urlgrabber/grabber.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/urlgrabber/grabber.py b/urlgrabber/grabber.py +index 35c091e..26335d1 100644 +--- a/urlgrabber/grabber.py ++++ b/urlgrabber/grabber.py +@@ -1298,12 +1298,12 @@ class PyCurlFileObject(object): + start = self._range[0] - pos + stop = self._range[1] - pos + if start < len(buf) and stop > 0: +- if not six.PY3 or isinstance(self.fo, StringIO): ++ if not six.PY3 and isinstance(self.fo, StringIO): + self.fo.write(buf[max(start, 0):stop].decode('utf-8')) + else: + self.fo.write(buf[max(start, 0):stop]) + else: +- if not six.PY3 or isinstance(self.fo, StringIO): ++ if not six.PY3 and isinstance(self.fo, StringIO): + self.fo.write(buf.decode('utf-8')) + else: + self.fo.write(buf) +-- +1.9.3 + diff --git a/python-urlgrabber.spec b/python-urlgrabber.spec index c810c38..aa07e19 100644 --- a/python-urlgrabber.spec +++ b/python-urlgrabber.spec @@ -3,12 +3,13 @@ Summary: A high-level cross-protocol url-grabber Name: python-urlgrabber Version: 3.10.1 -Release: 3%{?dist} +Release: 4%{?dist} Source0: http://urlgrabber.baseurl.org/download/urlgrabber-%{version}.tar.gz Patch1: urlgrabber-HEAD.patch Patch2: BZ-1051554-speed-on-404-mirror.patch Patch3: port-to-python3.patch Patch4: port-tests-to-python3.patch +Patch5: fix-stringio.patch License: LGPLv2+ Group: Development/Libraries @@ -30,6 +31,7 @@ authentication, proxies and more. %patch2 -p1 %patch3 -p1 %patch4 -p1 +%patch5 -p1 %build python setup.py build @@ -52,6 +54,9 @@ rm -rf $RPM_BUILD_ROOT %attr(0755,root,root) %{_libexecdir}/urlgrabber-ext-down %changelog +* Tue Sep 02 2014 Tomas Radej - 3.10.1-4 +- Fixed UTF behaviour (bz #1135632) + * Fri Aug 29 2014 Valentina Mukhamedzhanova - 3.10.1-3 - Don't set speed=0 on a new mirror that 404'd. BZ 1051554 - Support both Python 2 and 3. BZ 985288