{"action":"created","issue":{"url":"https://api.github.com/repos/enthought/traits/issues/243","repository_url":"https://api.github.com/repos/enthought/traits","labels_url":"https://api.github.com/repos/enthought/traits/issues/243/labels{/name}","comments_url":"https://api.github.com/repos/enthought/traits/issues/243/comments","events_url":"https://api.github.com/repos/enthought/traits/issues/243/events","html_url":"https://github.com/enthought/traits/pull/243","id":78570578,"number":243,"title":"More details in invalid_attribute_error","user":{"login":"jonathanrocher","id":593945,"avatar_url":"https://avatars.githubusercontent.com/u/593945?v=3","gravatar_id":"","url":"https://api.github.com/users/jonathanrocher","html_url":"https://github.com/jonathanrocher","followers_url":"https://api.github.com/users/jonathanrocher/followers","following_url":"https://api.github.com/users/jonathanrocher/following{/other_user}","gists_url":"https://api.github.com/users/jonathanrocher/gists{/gist_id}","starred_url":"https://api.github.com/users/jonathanrocher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonathanrocher/subscriptions","organizations_url":"https://api.github.com/users/jonathanrocher/orgs","repos_url":"https://api.github.com/users/jonathanrocher/repos","events_url":"https://api.github.com/users/jonathanrocher/events{/privacy}","received_events_url":"https://api.github.com/users/jonathanrocher/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2015-05-20T15:30:21Z","updated_at":"2016-06-07T10:33:46Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/enthought/traits/pulls/243","html_url":"https://github.com/enthought/traits/pull/243","diff_url":"https://github.com/enthought/traits/pull/243.diff","patch_url":"https://github.com/enthought/traits/pull/243.patch"},"body":"Added the bad type received to the error message when attribute lookup fails. To exercise this, you can run:\r\n```\r\nfrom traits.api import HasTraits, Int\r\n\r\nclass A(HasTraits):\r\n    x = Int\r\n\r\na = A()\r\nprint a.__getattribute__(\"x\")\r\nprint a.__getattribute__(0)\r\n```\r\nwhich would give \r\n```\r\n0\r\n---------------------------------------------------------------------------\r\nTypeError                                 Traceback (most recent call last)\r\n/Users/jrocher/Code-samples/Traits/test_getattr_error.py in <module>()\r\n      8 \r\n      9 print a.__getattribute__(\"x\")\r\n---> 10 print a.__getattribute__(0)\r\n\r\nTypeError: attribute name must be an instance of <type 'str'>. Got 0 (int).\r\n```\r\n\r\nFeedback requested."},"comment":{"url":"https://api.github.com/repos/enthought/traits/issues/comments/224242331","html_url":"https://github.com/enthought/traits/pull/243#issuecomment-224242331","issue_url":"https://api.github.com/repos/enthought/traits/issues/243","id":224242331,"user":{"login":"mdickinson","id":662003,"avatar_url":"https://avatars.githubusercontent.com/u/662003?v=3","gravatar_id":"","url":"https://api.github.com/users/mdickinson","html_url":"https://github.com/mdickinson","followers_url":"https://api.github.com/users/mdickinson/followers","following_url":"https://api.github.com/users/mdickinson/following{/other_user}","gists_url":"https://api.github.com/users/mdickinson/gists{/gist_id}","starred_url":"https://api.github.com/users/mdickinson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mdickinson/subscriptions","organizations_url":"https://api.github.com/users/mdickinson/orgs","repos_url":"https://api.github.com/users/mdickinson/repos","events_url":"https://api.github.com/users/mdickinson/events{/privacy}","received_events_url":"https://api.github.com/users/mdickinson/received_events","type":"User","site_admin":false},"created_at":"2016-06-07T10:33:46Z","updated_at":"2016-06-07T10:33:46Z","body":"The C code is not valid C89, and the version of MSVC that Appveyor is using doesn't allow the C99 extension of arbitrarily-placed declarations. Fixing ..."}}
{"actor":{"display_login":"mdickinson"}}