All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][v2] fetch2/wget: fixup case with no useful netrc data
@ 2016-12-21  2:50 Mark Asselstine
  0 siblings, 0 replies; only message in thread
From: Mark Asselstine @ 2016-12-21  2:50 UTC (permalink / raw)
  To: msm-oss, bitbake-devel

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 <mark.asselstine@windriver.com>
---
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



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2016-12-21  2:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-21  2:50 [PATCH][v2] fetch2/wget: fixup case with no useful netrc data Mark Asselstine

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.