Don't return .text in urlopen

This commit is contained in:
Ruud
2014-01-17 22:38:02 +01:00
parent d9b9447242
commit 082da6e3a6
3 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -127,7 +127,7 @@ class Plugin(object):
return False
# http request
def urlopen(self, url, timeout = 30, data = None, headers = None, files = None, show_error = True, return_raw = False):
def urlopen(self, url, timeout = 30, data = None, headers = None, files = None, show_error = True):
url = urllib2.quote(ss(url), safe = "%/:=&?~#+!$,;'@()*[]")
if not headers: headers = {}
@@ -172,7 +172,7 @@ class Plugin(object):
log.info('Opening url: %s %s, data: %s', (method, url, [x for x in data.iterkeys()] if isinstance(data, dict) else 'with data'))
response = r.request(method, url, verify = False, **kwargs)
data = response.content if return_raw else response.text
data = response.content
self.http_failed_request[host] = 0
except (IOError, MaxRetryError, Timeout):