New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error if no charset encoding in response headers #259
Labels
Comments
Could you post a code sample with a URL that is producing the error for you? I am not getting any errors using Python 3.6:
Thanks for the report! |
Thanks! I'll reproduce that with a local server.
|
To solve my problem, I replaced the line https://github.com/kinverarity1/lasio/blob/master/lasio/reader.py#L80 with the following code : if response.headers.get_content_charset() is None:
if 'encoding' in encoding_kwargs:
encoding=encoding_kwargs['encoding']
else :
encoding='utf-8'
else:
encoding = response.headers.get_content_charset() Tell me if you want a PR |
Looks good, yes a PR would be great, I will merge from there
Thanks
|
ae3e
added a commit
to ae3e/lasio
that referenced
this issue
Oct 18, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
hi,
I tried to read a las file from a url in Jupyter.
In the response headers, the
content-type
is onlytext/plain
. There's no charset.Then I got the following error :
Could it be possible to use the define enconding like this :
The text was updated successfully, but these errors were encountered: