{"action":"created","issue":{"url":"https://api.github.com/repos/CSSE1001/MyPyTutor/issues/151","labels_url":"https://api.github.com/repos/CSSE1001/MyPyTutor/issues/151/labels{/name}","comments_url":"https://api.github.com/repos/CSSE1001/MyPyTutor/issues/151/comments","events_url":"https://api.github.com/repos/CSSE1001/MyPyTutor/issues/151/events","html_url":"https://github.com/CSSE1001/MyPyTutor/issues/151","id":60295535,"number":151,"title":"problem with the raising an exception problem","user":{"login":"pjritee","id":4810594,"avatar_url":"https://avatars.githubusercontent.com/u/4810594?v=3","gravatar_id":"","url":"https://api.github.com/users/pjritee","html_url":"https://github.com/pjritee","followers_url":"https://api.github.com/users/pjritee/followers","following_url":"https://api.github.com/users/pjritee/following{/other_user}","gists_url":"https://api.github.com/users/pjritee/gists{/gist_id}","starred_url":"https://api.github.com/users/pjritee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pjritee/subscriptions","organizations_url":"https://api.github.com/users/pjritee/orgs","repos_url":"https://api.github.com/users/pjritee/repos","events_url":"https://api.github.com/users/pjritee/events{/privacy}","received_events_url":"https://api.github.com/users/pjritee/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/CSSE1001/MyPyTutor/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":{"login":"sapi","id":1009826,"avatar_url":"https://avatars.githubusercontent.com/u/1009826?v=3","gravatar_id":"","url":"https://api.github.com/users/sapi","html_url":"https://github.com/sapi","followers_url":"https://api.github.com/users/sapi/followers","following_url":"https://api.github.com/users/sapi/following{/other_user}","gists_url":"https://api.github.com/users/sapi/gists{/gist_id}","starred_url":"https://api.github.com/users/sapi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sapi/subscriptions","organizations_url":"https://api.github.com/users/sapi/orgs","repos_url":"https://api.github.com/users/sapi/repos","events_url":"https://api.github.com/users/sapi/events{/privacy}","received_events_url":"https://api.github.com/users/sapi/received_events","type":"User","site_admin":false},"milestone":null,"comments":1,"created_at":"2015-03-09T03:57:28Z","updated_at":"2015-03-09T04:22:50Z","closed_at":"2015-03-09T04:22:39Z","body":"this comes from a posting on piazza (slightly modified).\r\n\r\nThe code is:\r\n\r\n```\r\nclass InvalidCommand(Exception):\r\n    pass\r\n\r\n\r\ndef validate_input(string):\r\n    \"\"\"\r\n    validate_input(str) -> (str, [float])\r\n\r\n    If string is a valid command, return its name and arguments.\r\n    If string is not a valid command, raise InvalidCommand\r\n\r\n    Valid commands:\r\n      add x y\r\n      sub x y\r\n      mul x y\r\n      div x y\r\n\r\n    Arguments x and y must be convertable to float.\r\n\r\n    \"\"\"\r\n    # your code here\r\n    cmd=string.split()\r\n    print(cmd)\r\n    if len(cmd)!=3 or cmd[0] not in [\"add\",\"sub\",\"mul\",\"div\"]:\r\n        raise InvalidCommand()\r\n    try:\r\n        float(cmd[1])\r\n        float(cmd[2])\r\n        error = False\r\n    except ValueError:\r\n        error=True\r\n    if error:\r\n        raise InvalidCommand()\r\n    out=(cmd[0],[float(cmd[1]),float(cmd[2])])\r\n    return out\r\n```\r\n\r\nand when I choose this problem after saving this code (and restarting)  it I get (in the terminal):\r\n\r\n```\r\nException in Tkinter callback\r\nTraceback (most recent call last):\r\n  File \"/usr/lib/python3.4/tkinter/__init__.py\", line 1490, in __call__\r\n    return self.func(*args)\r\n  File \"/home/pjr/MyPyTutor/tutorlib/gui/app/menu.py\", line 262, in <lambda>\r\n    cb = (lambda t=tutorial: lambda: self.problem_callback(t))()\r\n  File \"/home/pjr/MyPyTutor/tutorlib/gui/app/menu.py\", line 215, in problem_callback\r\n    self.delegate.change_problem(problem=tutorial)\r\n  File \"/home/pjr/MyPyTutor/tutorlib/utils/decorators.py\", line 10, in method\r\n    return f(self, *args, **kwargs)\r\n  File \"/home/pjr/MyPyTutor/tutorlib/gui/app/app.py\", line 523, in change_problem\r\n    self.run_tests()\r\n  File \"/home/pjr/MyPyTutor/tutorlib/utils/decorators.py\", line 10, in method\r\n    return f(self, *args, **kwargs)\r\n  File \"/home/pjr/MyPyTutor/tutorlib/gui/app/app.py\", line 396, in run_tests\r\n    self.current_tutorial, code_text\r\n  File \"/home/pjr/MyPyTutor/tutorlib/interface/tests.py\", line 64, in run_tests\r\n    analyser.analyse(text)\r\n  File \"/home/pjr/MyPyTutor/tutorlib/analysis/analyser.py\", line 118, in analyse\r\n    handle_event[event](node)\r\n  File \"/usr/lib/python3.4/ast.py\", line 245, in visit\r\n    return visitor(node)\r\n  File \"/home/pjr/MyPyTutor/tutorlib/analysis/visitor.py\", line 278, in visit_Assign\r\n    fn.assigned_value_of[assignment_value].append(target_id)\r\n  File \"/home/pjr/MyPyTutor/tutorlib/analysis/support.py\", line 121, in __getitem__\r\n    return self._store[self._convert_key(key)]\r\nTypeError: unhashable type: 'list'\r\n```\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/CSSE1001/MyPyTutor/issues/comments/77798431","html_url":"https://github.com/CSSE1001/MyPyTutor/issues/151#issuecomment-77798431","issue_url":"https://api.github.com/repos/CSSE1001/MyPyTutor/issues/151","id":77798431,"user":{"login":"sapi","id":1009826,"avatar_url":"https://avatars.githubusercontent.com/u/1009826?v=3","gravatar_id":"","url":"https://api.github.com/users/sapi","html_url":"https://github.com/sapi","followers_url":"https://api.github.com/users/sapi/followers","following_url":"https://api.github.com/users/sapi/following{/other_user}","gists_url":"https://api.github.com/users/sapi/gists{/gist_id}","starred_url":"https://api.github.com/users/sapi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sapi/subscriptions","organizations_url":"https://api.github.com/users/sapi/orgs","repos_url":"https://api.github.com/users/sapi/repos","events_url":"https://api.github.com/users/sapi/events{/privacy}","received_events_url":"https://api.github.com/users/sapi/received_events","type":"User","site_admin":false},"created_at":"2015-03-09T04:22:50Z","updated_at":"2015-03-09T04:22:50Z","body":"Fixed.  Tell him thanks!"}}