{"action":"created","issue":{"url":"https://api.github.com/repos/danthedeckie/simpleeval/issues/41","repository_url":"https://api.github.com/repos/danthedeckie/simpleeval","labels_url":"https://api.github.com/repos/danthedeckie/simpleeval/issues/41/labels{/name}","comments_url":"https://api.github.com/repos/danthedeckie/simpleeval/issues/41/comments","events_url":"https://api.github.com/repos/danthedeckie/simpleeval/issues/41/events","html_url":"https://github.com/danthedeckie/simpleeval/issues/41","id":347286627,"node_id":"MDU6SXNzdWUzNDcyODY2Mjc=","number":41,"title":"FunctionNotDefined object has no attribute 'func_name'","user":{"login":"ComaVN","id":3532339,"node_id":"MDQ6VXNlcjM1MzIzMzk=","avatar_url":"https://avatars0.githubusercontent.com/u/3532339?v=4","gravatar_id":"","url":"https://api.github.com/users/ComaVN","html_url":"https://github.com/ComaVN","followers_url":"https://api.github.com/users/ComaVN/followers","following_url":"https://api.github.com/users/ComaVN/following{/other_user}","gists_url":"https://api.github.com/users/ComaVN/gists{/gist_id}","starred_url":"https://api.github.com/users/ComaVN/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ComaVN/subscriptions","organizations_url":"https://api.github.com/users/ComaVN/orgs","repos_url":"https://api.github.com/users/ComaVN/repos","events_url":"https://api.github.com/users/ComaVN/events{/privacy}","received_events_url":"https://api.github.com/users/ComaVN/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-08-03T07:20:14Z","updated_at":"2018-08-08T19:16:18Z","closed_at":null,"author_association":"NONE","body":"According to [the source code](https://github.com/danthedeckie/simpleeval/blame/0.9.5/simpleeval.py#L113), the `FunctionNotDefined` exception has an attribute `func_name`, and has had it since the initial commit. However, when using `pip` to install the package, the same section looks like this:\r\n\r\n```\r\nclass FunctionNotDefined(InvalidExpression):\r\n    \"\"\" sorry! That function isn't defined! \"\"\"\r\n    def __init__(self, func_name, expression):\r\n        self.message = \"Function '{0}' not defined,\" \\\r\n                       \" for expression '{1}'.\".format(func_name, expression)\r\n        self.__name__ = func_name\r\n        self.expression = expression\r\n```\r\n\r\nso the attribute is called `__name__`.\r\n\r\nThe weird thing is, that the tar on [PyPI](https://pypi.org/project/simpleeval/#files) DOES seem to contain the correct code (no diff with the github version.\r\n\r\nWhat's going on here?\r\n\r\nTo reproduce, I did:\r\n\r\n```\r\ndocker run --rm -it python:3.7.0-stretch bash\r\npip install simpleeval\r\ngrep -A6 'class FunctionNotDefined' /usr/local/lib/python3.7/site-packages/simpleeval.py\r\n```"},"comment":{"url":"https://api.github.com/repos/danthedeckie/simpleeval/issues/comments/411520644","html_url":"https://github.com/danthedeckie/simpleeval/issues/41#issuecomment-411520644","issue_url":"https://api.github.com/repos/danthedeckie/simpleeval/issues/41","id":411520644,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMTUyMDY0NA==","user":{"login":"danthedeckie","id":1070206,"node_id":"MDQ6VXNlcjEwNzAyMDY=","avatar_url":"https://avatars3.githubusercontent.com/u/1070206?v=4","gravatar_id":"","url":"https://api.github.com/users/danthedeckie","html_url":"https://github.com/danthedeckie","followers_url":"https://api.github.com/users/danthedeckie/followers","following_url":"https://api.github.com/users/danthedeckie/following{/other_user}","gists_url":"https://api.github.com/users/danthedeckie/gists{/gist_id}","starred_url":"https://api.github.com/users/danthedeckie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danthedeckie/subscriptions","organizations_url":"https://api.github.com/users/danthedeckie/orgs","repos_url":"https://api.github.com/users/danthedeckie/repos","events_url":"https://api.github.com/users/danthedeckie/events{/privacy}","received_events_url":"https://api.github.com/users/danthedeckie/received_events","type":"User","site_admin":false},"created_at":"2018-08-08T19:16:18Z","updated_at":"2018-08-08T19:16:18Z","author_association":"OWNER","body":"Oh that's weird.  I guess it must be a 2to3 or similar conversion tool problem...\r\nProbably lib2to3/fixes/fix_funcattrs.py getting confused.\r\n\r\nPlease could you confirm that this is fixed with 0.9.6?  I've changed the way it works now to use setattr rather than directly .func_name, which I think should bypass 2to3.\r\n\r\nI added a couple test cases too for this issue.\r\n\r\n"}}
{"actor":{"display_login":"danthedeckie"}}