{"action":"created","issue":{"url":"https://api.github.com/repos/stchris/untangle/issues/17","repository_url":"https://api.github.com/repos/stchris/untangle","labels_url":"https://api.github.com/repos/stchris/untangle/issues/17/labels{/name}","comments_url":"https://api.github.com/repos/stchris/untangle/issues/17/comments","events_url":"https://api.github.com/repos/stchris/untangle/issues/17/events","html_url":"https://github.com/stchris/untangle/issues/17","id":87431553,"number":17,"title":"Python 3 compatible","user":{"login":"robnardo","id":12520995,"avatar_url":"https://avatars.githubusercontent.com/u/12520995?v=3","gravatar_id":"","url":"https://api.github.com/users/robnardo","html_url":"https://github.com/robnardo","followers_url":"https://api.github.com/users/robnardo/followers","following_url":"https://api.github.com/users/robnardo/following{/other_user}","gists_url":"https://api.github.com/users/robnardo/gists{/gist_id}","starred_url":"https://api.github.com/users/robnardo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robnardo/subscriptions","organizations_url":"https://api.github.com/users/robnardo/orgs","repos_url":"https://api.github.com/users/robnardo/repos","events_url":"https://api.github.com/users/robnardo/events{/privacy}","received_events_url":"https://api.github.com/users/robnardo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2015-06-11T18:00:10Z","updated_at":"2016-07-13T06:47:57Z","closed_at":null,"body":"Hi, i am using your library and receiving some errors when trying to run it using Python 3.4.0.  I recently started working with python (so not an expert), but i was able to fix it for my needs by editing **untagle.py** on lines 143 and 149 and it worked.  \r\n\r\nSo I changed line 143 to `parser.parse(StringIO(filename.decode('utf-8')))` and line 149 to \r\n`return string.startswith(b'http://') or string.startswith(b'https://')`"},"comment":{"url":"https://api.github.com/repos/stchris/untangle/issues/comments/232270840","html_url":"https://github.com/stchris/untangle/issues/17#issuecomment-232270840","issue_url":"https://api.github.com/repos/stchris/untangle/issues/17","id":232270840,"user":{"login":"rhaamo","id":8625,"avatar_url":"https://avatars.githubusercontent.com/u/8625?v=3","gravatar_id":"","url":"https://api.github.com/users/rhaamo","html_url":"https://github.com/rhaamo","followers_url":"https://api.github.com/users/rhaamo/followers","following_url":"https://api.github.com/users/rhaamo/following{/other_user}","gists_url":"https://api.github.com/users/rhaamo/gists{/gist_id}","starred_url":"https://api.github.com/users/rhaamo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rhaamo/subscriptions","organizations_url":"https://api.github.com/users/rhaamo/orgs","repos_url":"https://api.github.com/users/rhaamo/repos","events_url":"https://api.github.com/users/rhaamo/events{/privacy}","received_events_url":"https://api.github.com/users/rhaamo/received_events","type":"User","site_admin":false},"created_at":"2016-07-13T06:47:57Z","updated_at":"2016-07-13T06:47:57Z","body":"I've needed to do the same as @robnardo , in my case I do something like:\r\n```\r\na=requests.get(\"http://whatever_returns_an_xml/\")\r\nb=untangle.parse(a.text)\r\n```\r\nThe XML returned contains sometimes unicode like ```Francés``` and without editing anything it explodes on cannot encode unicode crap.\r\nIf I do ```untangle.parse(a.encode('UTF-8'))``` it will explodes like:\r\n```\r\n  File \"/usr/local/lib/python3.4/dist-packages/untangle.py\", line 149, in is_url\r\n    return string.startswith('http://') or string.startswith('https://')\r\nTypeError: <flask_script.commands.Command object at 0x7f70316c34e0>: startswith first arg must be bytes or a tuple of bytes, not str\r\n```\r\nSo using robnardo's edit it works as expected.\r\n\r\nps: I use requests and not untangle's one as I need to edit some headers before sending the request"}}
{"actor":{"display_login":"rhaamo"}}