Tell requests to detect encoding.

Changed the get_file_by_url function to infer/guess the encoding of the content we receive.
This commit is contained in:
Alexander Cecile 2020-08-18 19:36:47 -04:00
parent 5186071948
commit 79bd7d4122

View File

@ -1467,7 +1467,9 @@ def maybe_copy_example_file(file_path):
def get_file_by_url(url, params, **kwargs):
return requests.get(url=url, params=params, **kwargs).text
req = requests.get(url=url, params=params, **kwargs)
req.encoding = req.apparent_encoding
return req.text
def write_data(f, data):