Fix UTF-8 behaviour (bz #1135632)

epel9
Tomas Radej 11 years ago committed by Valentina Mukhamedzhanova
parent 198714bffb
commit 9a2719055a

@ -0,0 +1,31 @@
From 62f94b534289b7ab0bda879962bf6efb124a9930 Mon Sep 17 00:00:00 2001
From: Tomas Radej <tradej@redhat.com>
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

@ -3,12 +3,13 @@
Summary: A high-level cross-protocol url-grabber Summary: A high-level cross-protocol url-grabber
Name: python-urlgrabber Name: python-urlgrabber
Version: 3.10.1 Version: 3.10.1
Release: 3%{?dist} Release: 4%{?dist}
Source0: http://urlgrabber.baseurl.org/download/urlgrabber-%{version}.tar.gz Source0: http://urlgrabber.baseurl.org/download/urlgrabber-%{version}.tar.gz
Patch1: urlgrabber-HEAD.patch Patch1: urlgrabber-HEAD.patch
Patch2: BZ-1051554-speed-on-404-mirror.patch Patch2: BZ-1051554-speed-on-404-mirror.patch
Patch3: port-to-python3.patch Patch3: port-to-python3.patch
Patch4: port-tests-to-python3.patch Patch4: port-tests-to-python3.patch
Patch5: fix-stringio.patch
License: LGPLv2+ License: LGPLv2+
Group: Development/Libraries Group: Development/Libraries
@ -30,6 +31,7 @@ authentication, proxies and more.
%patch2 -p1 %patch2 -p1
%patch3 -p1 %patch3 -p1
%patch4 -p1 %patch4 -p1
%patch5 -p1
%build %build
python setup.py build python setup.py build
@ -52,6 +54,9 @@ rm -rf $RPM_BUILD_ROOT
%attr(0755,root,root) %{_libexecdir}/urlgrabber-ext-down %attr(0755,root,root) %{_libexecdir}/urlgrabber-ext-down
%changelog %changelog
* Tue Sep 02 2014 Tomas Radej <tradej@redhat.com> - 3.10.1-4
- Fixed UTF behaviour (bz #1135632)
* Fri Aug 29 2014 Valentina Mukhamedzhanova <vmukhame@redhat.com> - 3.10.1-3 * Fri Aug 29 2014 Valentina Mukhamedzhanova <vmukhame@redhat.com> - 3.10.1-3
- Don't set speed=0 on a new mirror that 404'd. BZ 1051554 - Don't set speed=0 on a new mirror that 404'd. BZ 1051554
- Support both Python 2 and 3. BZ 985288 - Support both Python 2 and 3. BZ 985288

Loading…
Cancel
Save