{"action":"created","issue":{"url":"https://api.github.com/repos/RDFLib/rdflib/issues/674","repository_url":"https://api.github.com/repos/RDFLib/rdflib","labels_url":"https://api.github.com/repos/RDFLib/rdflib/issues/674/labels{/name}","comments_url":"https://api.github.com/repos/RDFLib/rdflib/issues/674/comments","events_url":"https://api.github.com/repos/RDFLib/rdflib/issues/674/events","html_url":"https://github.com/RDFLib/rdflib/pull/674","id":193263119,"number":674,"title":"Only use unicode-compatible values for lexical space","user":{"login":"nateprewitt","id":5271761,"avatar_url":"https://avatars.githubusercontent.com/u/5271761?v=3","gravatar_id":"","url":"https://api.github.com/users/nateprewitt","html_url":"https://github.com/nateprewitt","followers_url":"https://api.github.com/users/nateprewitt/followers","following_url":"https://api.github.com/users/nateprewitt/following{/other_user}","gists_url":"https://api.github.com/users/nateprewitt/gists{/gist_id}","starred_url":"https://api.github.com/users/nateprewitt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nateprewitt/subscriptions","organizations_url":"https://api.github.com/users/nateprewitt/orgs","repos_url":"https://api.github.com/users/nateprewitt/repos","events_url":"https://api.github.com/users/nateprewitt/events{/privacy}","received_events_url":"https://api.github.com/users/nateprewitt/received_events","type":"User","site_admin":false},"labels":[{"id":238420,"url":"https://api.github.com/repos/RDFLib/rdflib/labels/bug","name":"bug","color":"e10c02","default":true},{"id":206101704,"url":"https://api.github.com/repos/RDFLib/rdflib/labels/discussion","name":"discussion","color":"bfe5bf","default":false},{"id":238421,"url":"https://api.github.com/repos/RDFLib/rdflib/labels/enhance","name":"enhance","color":"02e10c","default":false},{"id":39591704,"url":"https://api.github.com/repos/RDFLib/rdflib/labels/parsing","name":"parsing","color":"eb6420","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/RDFLib/rdflib/milestones/2","html_url":"https://github.com/RDFLib/rdflib/milestone/2","labels_url":"https://api.github.com/repos/RDFLib/rdflib/milestones/2/labels","id":346230,"number":2,"title":"rdflib 5.0.0","description":"5.0! The bright new future!\r\n\r\nWith strong AI!","creator":{"login":"gromgull","id":178028,"avatar_url":"https://avatars.githubusercontent.com/u/178028?v=3","gravatar_id":"","url":"https://api.github.com/users/gromgull","html_url":"https://github.com/gromgull","followers_url":"https://api.github.com/users/gromgull/followers","following_url":"https://api.github.com/users/gromgull/following{/other_user}","gists_url":"https://api.github.com/users/gromgull/gists{/gist_id}","starred_url":"https://api.github.com/users/gromgull/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gromgull/subscriptions","organizations_url":"https://api.github.com/users/gromgull/orgs","repos_url":"https://api.github.com/users/gromgull/repos","events_url":"https://api.github.com/users/gromgull/events{/privacy}","received_events_url":"https://api.github.com/users/gromgull/received_events","type":"User","site_admin":false},"open_issues":30,"closed_issues":7,"state":"open","created_at":"2013-06-01T12:32:31Z","updated_at":"2017-01-24T13:18:21Z","due_on":null,"closed_at":null},"comments":19,"created_at":"2016-12-03T03:43:35Z","updated_at":"2017-01-24T14:05:03Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/RDFLib/rdflib/pulls/674","html_url":"https://github.com/RDFLib/rdflib/pull/674","diff_url":"https://github.com/RDFLib/rdflib/pull/674.diff","patch_url":"https://github.com/RDFLib/rdflib/pull/674.patch"},"body":"This is an attempt to address #646. Right now, rdflib assumes that base64 encoded strings contain unicode content upon decode. This is often not the case, specifically for things like images and PDFs.\r\n\r\nThis will allow the user to still retrieve the base64 string as it's stored in the triplestore and choose how to handle the data from there.\r\n\r\nI'm currently filing this against master, but it does seem like a somewhat breaking change, so I can refile against the 5.0.0 branch if needed."},"comment":{"url":"https://api.github.com/repos/RDFLib/rdflib/issues/comments/274810822","html_url":"https://github.com/RDFLib/rdflib/pull/674#issuecomment-274810822","issue_url":"https://api.github.com/repos/RDFLib/rdflib/issues/674","id":274810822,"user":{"login":"nateprewitt","id":5271761,"avatar_url":"https://avatars.githubusercontent.com/u/5271761?v=3","gravatar_id":"","url":"https://api.github.com/users/nateprewitt","html_url":"https://github.com/nateprewitt","followers_url":"https://api.github.com/users/nateprewitt/followers","following_url":"https://api.github.com/users/nateprewitt/following{/other_user}","gists_url":"https://api.github.com/users/nateprewitt/gists{/gist_id}","starred_url":"https://api.github.com/users/nateprewitt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nateprewitt/subscriptions","organizations_url":"https://api.github.com/users/nateprewitt/orgs","repos_url":"https://api.github.com/users/nateprewitt/repos","events_url":"https://api.github.com/users/nateprewitt/events{/privacy}","received_events_url":"https://api.github.com/users/nateprewitt/received_events","type":"User","site_admin":false},"created_at":"2017-01-24T14:05:03Z","updated_at":"2017-01-24T14:05:03Z","body":"Hmm, I'm a bit torn here. My knee jerk reaction is bigger blocks in the try introduces a higher likelihood of masking exceptions. Particularly, it'll be easy to overlook with future additions/changes to those branch statements.\r\n\r\nThat said, it seems pretty unlikely this function will change much. I updated the branches and I think it makes the `decode` line easier to grock, but the rest of the code (for me at least) becomes a bit fuzzier. I think I'm -.5 on this but can make the change if you feel strongly about it.\r\n\r\n```python\r\n    try:\r\n        if isinstance(value, bytes):\r\n            value.decode('utf-8')\r\n        elif py3compat.PY3:\r\n            str(value)\r\n        else:\r\n            unicode(value)\r\n    except UnicodeError:\r\n        return False\r\n    return True\r\n```\r\n "}}
{"actor":{"display_login":"nateprewitt"}}