Skip to content
Myr

remove bunk utils for decoding

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Kenneth Reitz · committed by Kenneth Reitz · parent dacaae5 · Browse files · 1 file+0 added−27 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+0 added−27 removed

  • other:+0 added−27 removed

1 file+0 added−27 removed

modified:requests/utils.py-27 removed
289 unmodified lines
290 if 'text' in content_type:291 return 'ISO-8859-1'292293294def unicode_from_html(content):295 """Attempts to decode an HTML string into unicode.296 If unsuccessful, the original content is returned.297 """298299 encodings = get_encodings_from_content(content)300301 for encoding in encodings:302303 try:304 return str(content, encoding)305 except (UnicodeError, TypeError):306 pass307308 return content309310294def stream_decode_response_unicode(iterator, r):295 """Stream decodes a iterator."""296297 if r.encoding is None:
42 unmodified lines
340 return str(r.content, encoding, errors='replace')341 except TypeError:342 return r.content343361362def decode_gzip(content):363 """Return gzip-decoded string.364365 :param content: bytestring to gzip-decode.366 """367368 return zlib.decompress(content, 16 + zlib.MAX_WBITS)369370344def stream_decompress(iterator, mode='gzip'):345 """346 Stream decodes an iterator over compressed data347
71 unmodified lines