{"action":"opened","issue":{"url":"https://api.github.com/repos/ansible/tacacs_plus/issues/23","repository_url":"https://api.github.com/repos/ansible/tacacs_plus","labels_url":"https://api.github.com/repos/ansible/tacacs_plus/issues/23/labels{/name}","comments_url":"https://api.github.com/repos/ansible/tacacs_plus/issues/23/comments","events_url":"https://api.github.com/repos/ansible/tacacs_plus/issues/23/events","html_url":"https://github.com/ansible/tacacs_plus/issues/23","id":257960069,"number":23,"title":"API inconsistencies between Python 2 & 3 (string handling)","user":{"login":"ether42","id":3048933,"avatar_url":"https://avatars2.githubusercontent.com/u/3048933?v=4","gravatar_id":"","url":"https://api.github.com/users/ether42","html_url":"https://github.com/ether42","followers_url":"https://api.github.com/users/ether42/followers","following_url":"https://api.github.com/users/ether42/following{/other_user}","gists_url":"https://api.github.com/users/ether42/gists{/gist_id}","starred_url":"https://api.github.com/users/ether42/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ether42/subscriptions","organizations_url":"https://api.github.com/users/ether42/orgs","repos_url":"https://api.github.com/users/ether42/repos","events_url":"https://api.github.com/users/ether42/events{/privacy}","received_events_url":"https://api.github.com/users/ether42/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-09-15T08:11:48Z","updated_at":"2017-09-15T08:11:48Z","closed_at":null,"author_association":"NONE","body":"Hi there,\r\n\r\nThis isn't a major issue as user code may work around it but it may be nice to look into it (because this library seems to be the only serious one available for the TACACS+ protocol) and a compatible API between different Python versions may be a nice thing to have (maybe it was simply overlooked because the code makes heavy use of `six`).\r\n\r\nI think there is a small inconsistency with the handling of strings between Python 2 & 3, a simple and idiomatic user code that could be executed under both major versions would be something like:\r\n```python\r\nfrom __future__ import print_function, unicode_literals\r\nimport tacacs_plus.client\r\n\r\nc = tacacs_plus.client.TACACSClient('tacacs', 49, 'testing123')\r\nprint(c.authenticate('test', 'toto').valid)\r\n```\r\n\r\nThis would work in Python 3 but would fails in Python 2 (in multiple places) due to `unicode_literals` as the library is expecting `str` and not `unicode` strings.\r\n\r\nRegards.\r\n"}}
{"actor":{"display_login":"ether42"}}