From c15b78085d2b36a5bae203aeba7dd2d4f0b41bd3 Mon Sep 17 00:00:00 2001 From: Robert-André Mauchin Date: Mar 16 2020 20:34:04 +0000 Subject: Use urllib instead of FancyURLopener Since we're Python 3 only there es no reason to use Six's FancyURLopener instead of standard urllib. FancyURLopener has issues opening Gitea URLs with a custom archive name (using the #/archive.tar.gz construction), returning a 404 error instead of 200 like urllib. Signed-off-by: Robert-André Mauchin --- diff --git a/src/FedoraReview/helpers_mixin.py b/src/FedoraReview/helpers_mixin.py index dcaa7a6..d40d469 100644 --- a/src/FedoraReview/helpers_mixin.py +++ b/src/FedoraReview/helpers_mixin.py @@ -23,7 +23,7 @@ Tools for helping Fedora package reviewers import logging import os.path import re -from six.moves.urllib.request import FancyURLopener +import urllib from subprocess import Popen, PIPE import hashlib @@ -83,7 +83,7 @@ class HelpersMixin(object): socket.setdefaulttimeout(30) - istream = FancyURLopener().open(url) + istream = urllib.request.urlopen(url) if istream.getcode() and istream.getcode() != 200: raise DownloadError(istream.getcode(), url) with open(path, "wb") as ostream: