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')

-- 
To view, visit https://gerrit.wikimedia.org/r/176331
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I18b0acbdb00ecfa474646efb5796d88664c1e173
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: XZise <commodorefabia...@gmx.de>
Gerrit-Reviewer: John Vandenberg <jay...@gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgr...@gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhall...@arctus.nl>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
Pywikibot-commits mailing list
Pywikibot-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/pywikibot-commits

Reply via email to