From commits-return-17212-apmail-allura-commits-archive=allura.apache.org@allura.apache.org Fri Mar 20 19:48:08 2020 Return-Path: X-Original-To: apmail-allura-commits-archive@www.apache.org Delivered-To: apmail-allura-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by minotaur.apache.org (Postfix) with SMTP id 6E9241988C for ; Fri, 20 Mar 2020 19:48:08 +0000 (UTC) Received: (qmail 67481 invoked by uid 500); 20 Mar 2020 19:48:08 -0000 Delivered-To: apmail-allura-commits-archive@allura.apache.org Received: (qmail 67434 invoked by uid 500); 20 Mar 2020 19:48:08 -0000 Mailing-List: contact commits-help@allura.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@allura.apache.org Delivered-To: mailing list commits@allura.apache.org Received: (qmail 67409 invoked by uid 99); 20 Mar 2020 19:48:07 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 20 Mar 2020 19:48:07 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id AE220819F7; Fri, 20 Mar 2020 19:48:07 +0000 (UTC) Date: Fri, 20 Mar 2020 19:48:07 +0000 To: "commits@allura.apache.org" Subject: [allura] branch master updated: [#8353] test fixes MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <158473368760.16483.3573337376341607569@gitbox.apache.org> From: brondsem@apache.org X-Git-Host: gitbox.apache.org X-Git-Repo: allura X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: d3f7964a2ae2433f7f899ab5b1349d69ab91a6ef X-Git-Newrev: 9de2a8f04d95cfb578c3daf62e1a91011945d7b9 X-Git-Rev: 9de2a8f04d95cfb578c3daf62e1a91011945d7b9 X-Git-NotificationType: ref_changed_plus_diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated This is an automated email from the ASF dual-hosted git repository. brondsem pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/allura.git The following commit(s) were added to refs/heads/master by this push: new 9de2a8f [#8353] test fixes 9de2a8f is described below commit 9de2a8f04d95cfb578c3daf62e1a91011945d7b9 Author: Dave Brondsema AuthorDate: Fri Mar 20 15:48:01 2020 -0400 [#8353] test fixes --- Allura/allura/lib/helpers.py | 2 +- ForgeImporters/forgeimporters/base.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Allura/allura/lib/helpers.py b/Allura/allura/lib/helpers.py index 02f8294..607774e 100644 --- a/Allura/allura/lib/helpers.py +++ b/Allura/allura/lib/helpers.py @@ -1032,7 +1032,7 @@ def urlopen(url, retries=3, codes=(408, 500, 502, 503, 504), timeout=None): url_string += ' => {}'.format(e.filename) if timeout is None: timeout = socket.getdefaulttimeout() - if hasattr(e, 'fp'): + if getattr(e, 'fp', None): body = e.fp.read() else: body = '' diff --git a/ForgeImporters/forgeimporters/base.py b/ForgeImporters/forgeimporters/base.py index 1e7208d..7f2b36f 100644 --- a/ForgeImporters/forgeimporters/base.py +++ b/ForgeImporters/forgeimporters/base.py @@ -172,8 +172,8 @@ class ProjectExtractor(object): def urlopen(url, retries=3, codes=(408, 500, 502, 503, 504), timeout=120, unredirected_hdrs=None, **kw): req = six.moves.urllib.request.Request(url, **kw) if unredirected_hdrs: - for k, v in unredirected_hdrs.items(): - req.add_unredirected_header(k, v) + for key, val in unredirected_hdrs.items(): + req.add_unredirected_header(key, val) req.add_header('User-Agent', 'Allura Data Importer (https://allura.apache.org/)') return h.urlopen(req, retries=retries, codes=codes, timeout=timeout)