-
Notifications
You must be signed in to change notification settings - Fork 565
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
if query result source has no encoding set, fall back to utf-8 encoding. #367
Conversation
Not quite sure about it, but the failing travis tests seem to be unrelated. And there is at least one scenario where this code is still problematic. The decoder will fail if you pass in a StringIO instance returning unicode characters. Otherwise I think it covers a few more use scenarios than before. |
yupp, sorry for the failures, master currently is broken, but fixed soon... |
Hi, Yes, read that stackoverflow, but had troubles installing the hub tool. However due to the resolves reference to issue #344, accepting this pull Good enough? Cheers Gerhard Sent from my iPad On 3 Mar 2014, at 7:25 pm, "Jörn Hees" [email protected] wrote: yupp, sorry for the failures, master currently is broken, but fixed soon... — |
sure, i was just confused about all the notifications ;) From my POV the fix seems ok |
Yeah, tried to attach the pull request to issue #344, that's why I created Sorry for the noise in the tracker. Sent from my iPad On 3 Mar 2014, at 9:28 pm, "Jörn Hees" [email protected] wrote: sure, i was just confused about all the notifications ;) From my POV the fix seems ok — |
Did you try the trick with reading a zero length string and seeing if you get unicode or bytes back? |
it may be a more robust heuristic |
otherwise it looks ok to me! The StringIO from a BytesIO was ugly anyway :) |
No, haven't thought about reading zero length string. Might fix the problem with StringIO returning unicode. I'll give it a try. |
How about this variant? The tests pass for me. If no one sees a problem with this variant, I'll squash the commits when merging. |
Changes Unknown when pulling 2498360 on gweis:master into * on RDFLib:master*. |
Looks good! Squash and merge! |
squashed into commit b7fa8d6 |
Thanks! |
It's a bit tricky to do this properly for python 2 and 3, but I think this patch goes into the right direction.
For later on I think rdflib should be clear about what source is, and what attributes, methods and return values are expected.
If that would be defined, then a user of the library would know when to wrap a source within a codec or not.
resolves #344