@@ -183,7 +183,7 @@ def decodePage(page, contentEncoding, contentType):
183183 # http://stackoverflow.com/questions/1089662/python-inflate-and-deflate-implementations
184184 data = StringIO .StringIO (zlib .decompress (page , - 15 ))
185185 else :
186- data = gzip .GzipFile ('' , 'rb' , 9 , StringIO .StringIO (page ))
186+ data = gzip .GzipFile ("" , "rb" , 9 , StringIO .StringIO (page ))
187187
188188 try :
189189 page = data .read ()
@@ -196,8 +196,8 @@ def decodePage(page, contentEncoding, contentType):
196196 httpCharset , metaCharset = None , None
197197
198198 # http://stackoverflow.com/questions/1020892/python-urllib2-read-to-unicode
199- if contentType and (contentType .find (' charset=' ) != - 1 ):
200- httpCharset = checkCharEncoding (contentType .split (' charset=' )[- 1 ])
199+ if contentType and (contentType .find (" charset=" ) != - 1 ):
200+ httpCharset = checkCharEncoding (contentType .split (" charset=" )[- 1 ])
201201
202202 metaCharset = checkCharEncoding (extractRegexResult (META_CHARSET_REGEX , page , re .DOTALL | re .IGNORECASE ))
203203
@@ -209,7 +209,7 @@ def decodePage(page, contentEncoding, contentType):
209209 else :
210210 kb .pageEncoding = conf .charset
211211
212- if contentType and not isinstance (page , unicode ) and any (map (lambda x : x in contentType .lower (), (' text/txt' , ' text/raw' , ' text/html' , ' text/xml' ))):
212+ if contentType and not isinstance (page , unicode ) and any (map (lambda x : x in contentType .lower (), (" text/txt" , " text/raw" , " text/html" , " text/xml" ))):
213213 # can't do for all responses because we need to support binary files too
214214 kb .pageEncoding = kb .pageEncoding or checkCharEncoding (getHeuristicCharEncoding (page ))
215215 page = getUnicode (page , kb .pageEncoding )
0 commit comments