From 234248cd23826764240e6ea1a4ac91c02cc23371 Mon Sep 17 00:00:00 2001 From: John Schember Date: Mon, 18 Apr 2011 18:57:28 -0400 Subject: [PATCH] Store: Fix issue with using proxy when an arument is None. --- src/calibre/gui2/store/web_control.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/calibre/gui2/store/web_control.py b/src/calibre/gui2/store/web_control.py index 874328f872..0b79c526a8 100644 --- a/src/calibre/gui2/store/web_control.py +++ b/src/calibre/gui2/store/web_control.py @@ -31,10 +31,14 @@ class NPWebView(QWebView): proxy_parts = urlparse(http_proxy) proxy = QNetworkProxy() proxy.setType(QNetworkProxy.HttpProxy) - proxy.setUser(proxy_parts.username) - proxy.setPassword(proxy_parts.password) - proxy.setHostName(proxy_parts.hostname) - proxy.setPort(proxy_parts.port) + if proxy_parts.username: + proxy.setUser(proxy_parts.username) + if proxy_parts.password: + proxy.setPassword(proxy_parts.password) + if proxy_parts.hostname: + proxy.setHostName(proxy_parts.hostname) + if proxy_parts.port: + proxy.setPort(proxy_parts.port) self.page().networkAccessManager().setProxy(proxy) self.page().setForwardUnsupportedContent(True)