diff --git a/python-urlgrabber.changes b/python-urlgrabber.changes index 31b1692..235fba6 100644 --- a/python-urlgrabber.changes +++ b/python-urlgrabber.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Tue Dec 21 14:02:50 UTC 2021 - Pablo Suárez Hernández + +- Use binary mode when reopening files + +- Added: + * use-binary-mode-when-reopening-files.patch + ------------------------------------------------------------------- Fri Oct 8 12:49:46 UTC 2021 - Matej Cepl diff --git a/python-urlgrabber.spec b/python-urlgrabber.spec index 6c02881..9732222 100644 --- a/python-urlgrabber.spec +++ b/python-urlgrabber.spec @@ -26,6 +26,9 @@ License: LGPL-2.1-only Group: Development/Libraries/Python URL: https://github.com/rpm-software-management/urlgrabber Source: https://github.com/rpm-software-management/%{modname}/releases/download/%{modname}-4-1-0/%{modname}-%{version}.tar.gz +# PATCH-FIX_UPSTREAM https://github.com/rpm-software-management/urlgrabber/pull/32 +Patch0: use-binary-mode-when-reopening-files.patch + BuildRequires: %{python_module pycurl} BuildRequires: %{python_module setuptools} BuildRequires: %{python_module six} @@ -47,6 +50,7 @@ throttling, authentication, proxies and more. %setup -q -n urlgrabber-%{version} # Remove with next release sed -i "13d" urlgrabber/__init__.py # Remove wrong license header, fixes bnc#781323 +%autopatch -p1 # Fix location of %%{_libexecdir} sed -i 's!/usr/libexec!%{_libexecdir}!' urlgrabber/grabber.py diff --git a/use-binary-mode-when-reopening-files.patch b/use-binary-mode-when-reopening-files.patch new file mode 100644 index 0000000..6cea91f --- /dev/null +++ b/use-binary-mode-when-reopening-files.patch @@ -0,0 +1,13 @@ +Index: urlgrabber-4.1.0/urlgrabber/grabber.py +=================================================================== +--- urlgrabber-4.1.0.orig/urlgrabber/grabber.py ++++ urlgrabber-4.1.0/urlgrabber/grabber.py +@@ -1857,7 +1857,7 @@ class PyCurlFileObject(object): + raise err + # re open it + try: +- self.fo = open(self.filename, 'r') ++ self.fo = open(self.filename, 'rb') + except IOError as e: + err = URLGrabError(16, _('error opening file from %s, IOError: %s') + % (self.url, e))