jenkins-bot has submitted this change and it was merged.
Change subject: [FIX] HTTP: Use urlparse to get host if site not given ......................................................................
[FIX] HTTP: Use urlparse to get host if site not given
Change-Id: I18b0acbdb00ecfa474646efb5796d88664c1e173 --- M pywikibot/comms/http.py 1 file changed, 2 insertions(+), 1 deletion(-)
Approvals: Merlijn van Deen: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/comms/http.py b/pywikibot/comms/http.py index f3e93c8..9e65821 100644 --- a/pywikibot/comms/http.py +++ b/pywikibot/comms/http.py @@ -241,6 +241,7 @@ site.ignore_certificate_error()) else: baseuri = uri + host = urlparse.urlparse(uri).netloc
format_string = kwargs.setdefault("headers", {}).get("user-agent") kwargs["headers"]["user-agent"] = user_agent(site, format_string) @@ -260,7 +261,7 @@ raise request.data
if request.data[0].status == 504: - raise Server504Error("Server %s timed out" % site.hostname()) + raise Server504Error("Server %s timed out" % host)
if request.data[0].status == 414: raise Server414Error('Too long GET request')