Return-Path: Received: from mail5.wrs.com (mail5.windriver.com [192.103.53.11]) by mail.openembedded.org (Postfix) with ESMTP id 26B287736F for ; Wed, 21 Dec 2016 02:50:05 +0000 (UTC) Received: from ALA-HCA.corp.ad.wrs.com (ala-hca.corp.ad.wrs.com [147.11.189.40]) by mail5.wrs.com (8.15.2/8.15.2) with ESMTPS id uBL2o7ST003920 (version=TLSv1 cipher=AES128-SHA bits=128 verify=OK); Tue, 20 Dec 2016 18:50:07 -0800 Received: from yow-cube2.wrs.com (128.224.56.99) by ALA-HCA.corp.ad.wrs.com (147.11.189.50) with Microsoft SMTP Server id 14.3.294.0; Tue, 20 Dec 2016 18:50:06 -0800 From: Mark Asselstine To: , Date: Tue, 20 Dec 2016 21:50:01 -0500 Message-ID: <1482288601-12269-1-git-send-email-mark.asselstine@windriver.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Subject: [PATCH][v2] fetch2/wget: fixup case with no useful netrc data X-BeenThere: bitbake-devel@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussion that advance bitbake development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Dec 2016 02:50:06 -0000 Content-Type: text/plain Commit 873e33d0479e977520106b65d149ff1799195bf6 [fetch2/wget: add Basic Auth from netrc to checkstatus()] causes "Fetcher failure for URL: 'https://www.example.com/'. URL https://www.example.com/ doesn't work." on new builds when a user has a .netrc file but there is no default and no matching host. The call to netrc.authenticators() will return None in these cases and the attempted assignment to the 3-tuple will raise a TypeError exception. Add the TypeError to the exceptions caught to get around this issue. Signed-off-by: Mark Asselstine --- v2: dropped the 'bitbake:' prefix from the shortlog and referenced commit lib/bb/fetch2/wget.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/bb/fetch2/wget.py b/lib/bb/fetch2/wget.py index 88349c9..737b98d 100644 --- a/lib/bb/fetch2/wget.py +++ b/lib/bb/fetch2/wget.py @@ -320,7 +320,7 @@ class Wget(FetchMethod): n = netrc.netrc() login, unused, password = n.authenticators(urllib.parse.urlparse(uri).hostname) add_basic_auth("%s:%s" % (login, password), r) - except (ImportError, IOError, netrc.NetrcParseError): + except (TypeError, ImportError, IOError, netrc.NetrcParseError): pass opener.open(r) -- 2.7.4