From 393b262e3c3b290455858c23486eeca17cf1b24f Mon Sep 17 00:00:00 2001 From: Lubomír Sedlář Date: Dec 13 2016 10:48:58 +0000 Subject: Fix upload with old PyCURL To replicate the crash, use upload command with these versions: * GitPython-1.0.1-5.el7.noarch * python-pycurl-7.19.0-19.el7.x86_6 Signed-off-by: Lubomír Sedlář --- diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 07ae1d0..152a1d4 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,6 +1,12 @@ ChangeLog ========= +Next +---- + +- Fix uploading sources with old PyCURL on EL 7 - BZ#1241059 (lsedlar) + + v1.47-1 (2016-12-02) -------------------- diff --git a/pyrpkg/lookaside.py b/pyrpkg/lookaside.py index a73c6f7..de97b91 100644 --- a/pyrpkg/lookaside.py +++ b/pyrpkg/lookaside.py @@ -260,6 +260,13 @@ class CGILookasideCache(object): """ filename = os.path.basename(filepath) + # RHEL 7 ships pycurl that does not accept unicode. When given unicode + # type it would explode with "unsupported second type in tuple". Let's + # convert to str just to be sure. + # https://bugzilla.redhat.com/show_bug.cgi?id=1241059 + if six.PY2 and isinstance(name, unicode): + name = name.encode('utf-8') + if self.remote_file_exists(name, filename, hash): self.log.info("File already uploaded: %s", filepath) return