I used the following python code to save an html file to local storage:
url = "some_url.html
urllib.request.urlretrieve(url, 'save/to/path')
This successfully saves the file with a .html extension. When I attempt to open the file with:
html_doc = open('save/to/path/some_url.html', 'r')
I get the following error:
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe5 in position 36255: ordinal not in range(128)
I think this means I am attempting to read a utf-8 file with a ascii codec. I attempted the solution found at:
Convert Unicode to ASCII without errors in Python
But this, as well as other solutions I have found, only seem to work for encoding the file for immediate viewing and not saved files. I cannot find one that works for altering the encoding of a locally stored file.