-
Notifications
You must be signed in to change notification settings - Fork 3
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
keepalive.HTTPResponse.read decodes response body as UTF-8 #2
Comments
Good point. However, it shouldn't return a |
That's exactly the background of the issue, see commit d202ed8 |
Python 2.7 does know the b prefix for string literals. Python 2.6 does not seem to do so. |
If you are very clever, you probably can do without any literals:
Once you do have a Any more concrete ideas? |
Or you can put some version-specific code at the top to get the right types:
where Then use them in the code:
|
@uholzer, personally I'd prefer to avoid such version specific code there. So I like more @joernhees' s proposal of using |
…ses the minimum python version to >=2.7
Patch available as |
python 2.6 supports the
so that will only restrict to >py2.5 and still supporting 2.5 seems like madness anyhow... that said i updated RDFLib/rdflib#550 to use the most recent keepalive package from github: https://travis-ci.org/RDFLib/rdflib/builds/92929930 (fixes py2 but still breaks something on py3) |
i think it fails on py3 as headers etc. inserted shouldn't be unicode strings either: e569c31#diff-f1079ce199a23a37972b8b644516f133R311 |
@joernhees you test faced just by luck another issue (see commit 018f118 for further context) with Since it fetches the So it looks to be ready. But I would prefer to have @uholzer also verifying the fix before getting out a new release. |
👍 thanks for digging through all this :-/ |
I would expect that the
keepalive.HTTPResponse.read
(overridinghttplib.HTTPResponse.read
) method returns str objects. Instead, it returns unicode objects. In fact, it decodes the body asUTF-8
in all cases. It shouldn't do that, because the encoding of the body may be different or the body may not even be text.The text was updated successfully, but these errors were encountered: