Skip to content

Commit

Permalink
Loaded web pages are expected to be unicode encoded. TODO: decode web…
Browse files Browse the repository at this point in the history
…pages according to encoding specified in its header
  • Loading branch information
Kate Churanova committed May 31, 2017
1 parent 48c3def commit 5e32cef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/lib/wp_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def Send(self,url,method='GET',payload=None,headers=None,cookie=None):
resp = urllib2.urlopen(req)
except urllib2.HTTPError,e:
resp = e
return resp.read(),resp.geturl(),resp.getcode(),resp.info()
return resp.read().decode('utf-8'),resp.geturl(),resp.getcode(),resp.info()

class NoRedirectHandler(urllib2.HTTPRedirectHandler):
def http_error_302(self,req,fp,code,msg,headers):
Expand Down

0 comments on commit 5e32cef

Please sign in to comment.