{"action":"created","issue":{"url":"https://api.github.com/repos/cannatag/ldap3/issues/177","repository_url":"https://api.github.com/repos/cannatag/ldap3","labels_url":"https://api.github.com/repos/cannatag/ldap3/issues/177/labels{/name}","comments_url":"https://api.github.com/repos/cannatag/ldap3/issues/177/comments","events_url":"https://api.github.com/repos/cannatag/ldap3/issues/177/events","html_url":"https://github.com/cannatag/ldap3/issues/177","id":153960061,"number":177,"title":"attribute argument in search() should accept any iterable","user":{"login":"klada","id":3250940,"avatar_url":"https://avatars.githubusercontent.com/u/3250940?v=3","gravatar_id":"","url":"https://api.github.com/users/klada","html_url":"https://github.com/klada","followers_url":"https://api.github.com/users/klada/followers","following_url":"https://api.github.com/users/klada/following{/other_user}","gists_url":"https://api.github.com/users/klada/gists{/gist_id}","starred_url":"https://api.github.com/users/klada/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/klada/subscriptions","organizations_url":"https://api.github.com/users/klada/orgs","repos_url":"https://api.github.com/users/klada/repos","events_url":"https://api.github.com/users/klada/events{/privacy}","received_events_url":"https://api.github.com/users/klada/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-05-10T09:18:00Z","updated_at":"2016-05-10T09:49:02Z","closed_at":null,"body":"`Connection.search()` supports a list of attributes to be specified to limit the amount of attributes in the result set.\r\n\r\nHowever it does not support the `dict_keys` type, which means that the following code works in Python2, but not in Python3:\r\n\r\n```python\r\nconn.search(base, filter, attributes=any_dict.keys())\r\n```\r\nThis is because `dict.keys()` returns a list in Python2. This could be fixed by either adding the `dict_keys` type to `SEQUENCE_TYPES` or by checking if the argument passed to `search()` as `attributes` is iterable.\r\n\r\nOf course this could also be fixed in the code using `ldap3`, but from what I have seen so far it is quite common to pass in dictionary keys as an attribute limiter for LDAP queries. And nevertheless with this issue `ldap3` is behaving differently on different Python versions."},"comment":{"url":"https://api.github.com/repos/cannatag/ldap3/issues/comments/218110291","html_url":"https://github.com/cannatag/ldap3/issues/177#issuecomment-218110291","issue_url":"https://api.github.com/repos/cannatag/ldap3/issues/177","id":218110291,"user":{"login":"cannatag","id":1319333,"avatar_url":"https://avatars.githubusercontent.com/u/1319333?v=3","gravatar_id":"","url":"https://api.github.com/users/cannatag","html_url":"https://github.com/cannatag","followers_url":"https://api.github.com/users/cannatag/followers","following_url":"https://api.github.com/users/cannatag/following{/other_user}","gists_url":"https://api.github.com/users/cannatag/gists{/gist_id}","starred_url":"https://api.github.com/users/cannatag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cannatag/subscriptions","organizations_url":"https://api.github.com/users/cannatag/orgs","repos_url":"https://api.github.com/users/cannatag/repos","events_url":"https://api.github.com/users/cannatag/events{/privacy}","received_events_url":"https://api.github.com/users/cannatag/received_events","type":"User","site_admin":false},"created_at":"2016-05-10T09:49:02Z","updated_at":"2016-05-10T09:49:02Z","body":"Thanks. The easiest solution is to add dict.keys to SEQUENCE_TYPES. I will check if this has drawbacks on the existing codebase and will include it in the next release of ldap3.\r\n\r\nBye,\r\nGiovanni"}}