diff options
author | Michal Domonkos <mdomonko@redhat.com> | 2019-05-20 15:06:38 +0200 |
---|---|---|
committer | Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com> | 2019-05-20 10:43:02 -0400 |
commit | 7607b9f408b71b6533ca4f8e8808090a5b930555 (patch) | |
tree | 38b0f439aeac9bf4eb377ece833fa14fcf89513b | |
parent | 00fe99d7142c555aa76015d98835cef1e8018ef7 (diff) | |
download | urlgrabber-7607b9f408b71b6533ca4f8e8808090a5b930555.tar.gz |
Revert "Simplify mirror conversion to utf8"
This reverts commit be8ee10e35319e80200d4ff384434d46fe7783d9.
A list of dicts (as opposed to strings) is valid input as well; see the
module-level doc string for details (section 2 under CUSTOMIZATION). In
fact, the nested estimate() function in MirrorGroup.__init__() accounts
for that, too.
This fixes a traceback in YUM which does pass such a dict list.
Closes #10.
-rw-r--r-- | urlgrabber/mirror.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/urlgrabber/mirror.py b/urlgrabber/mirror.py index 75f0bcb..d95863e 100644 --- a/urlgrabber/mirror.py +++ b/urlgrabber/mirror.py @@ -297,7 +297,12 @@ class MirrorGroup: self.default_action = kwargs.get('default_action') def _parse_mirrors(self, mirrors): - return [{'mirror':_to_utf8(m)} for m in mirrors] + parsed_mirrors = [] + for m in mirrors: + if isinstance(m, string_types): + m = {'mirror': _to_utf8(m)} + parsed_mirrors.append(m) + return parsed_mirrors def _load_gr(self, gr): # OVERRIDE IDEAS: |