{"action":"created","issue":{"url":"https://api.github.com/repos/benbaptist/minecraft-wrapper/issues/75","labels_url":"https://api.github.com/repos/benbaptist/minecraft-wrapper/issues/75/labels{/name}","comments_url":"https://api.github.com/repos/benbaptist/minecraft-wrapper/issues/75/comments","events_url":"https://api.github.com/repos/benbaptist/minecraft-wrapper/issues/75/events","html_url":"https://github.com/benbaptist/minecraft-wrapper/issues/75","id":54831734,"number":75,"title":"\"blah blah\"  is not JSON serializable","user":{"login":"suresttexas00","id":10001762,"avatar_url":"https://avatars.githubusercontent.com/u/10001762?v=3","gravatar_id":"","url":"https://api.github.com/users/suresttexas00","html_url":"https://github.com/suresttexas00","followers_url":"https://api.github.com/users/suresttexas00/followers","following_url":"https://api.github.com/users/suresttexas00/following{/other_user}","gists_url":"https://api.github.com/users/suresttexas00/gists{/gist_id}","starred_url":"https://api.github.com/users/suresttexas00/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/suresttexas00/subscriptions","organizations_url":"https://api.github.com/users/suresttexas00/orgs","repos_url":"https://api.github.com/users/suresttexas00/repos","events_url":"https://api.github.com/users/suresttexas00/events{/privacy}","received_events_url":"https://api.github.com/users/suresttexas00/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-01-20T01:08:45Z","updated_at":"2015-01-21T22:17:00Z","closed_at":"2015-01-21T05:51:31Z","body":"What does it mean sometihng is not JSON serializable? This happens whenever i do something like:\r\n\r\n\t\t\tplayerUuid = player.uuid\r\n\t\t\thumanname = str([player.username])\r\n\t\t\tself.container[\"hiddenplayers\"][humanname] = playerUuid\r\n\r\n```\r\nTraceback (most recent call last):\r\n  File \"C:\\Python27\\lib\\threading.py\", line 810, in __bootstrap_inner\r\n    self.run()\r\n  File \"C:\\Python27\\lib\\threading.py\", line 763, in run\r\n    self.__target(*self.__args, **self.__kwargs)\r\n  File \"Wrapper\\storage.py\", line 39, in periodicSave\r\n    self.save()\r\n  File \"Wrapper\\storage.py\", line 56, in save\r\n    f.write(json.dumps(self.data))\r\n  File \"C:\\Python27\\lib\\json\\__init__.py\", line 243, in dumps\r\n    return _default_encoder.encode(obj)\r\n  File \"C:\\Python27\\lib\\json\\encoder.py\", line 207, in encode\r\n    chunks = self.iterencode(o, _one_shot=True)\r\n  File \"C:\\Python27\\lib\\json\\encoder.py\", line 270, in iterencode\r\n    return _iterencode(o, 0)\r\n  File \"C:\\Python27\\lib\\json\\encoder.py\", line 184, in default\r\n    raise TypeError(repr(o) + \" is not JSON serializable\")\r\n  TypeError: UUID('4f953255-6775-4dc6-a612-fb4230588eff') is not JSON serializable\r\n```\r\nthis seems to be happening when it attempts to save to disk\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/benbaptist/minecraft-wrapper/issues/comments/70933076","html_url":"https://github.com/benbaptist/minecraft-wrapper/issues/75#issuecomment-70933076","issue_url":"https://api.github.com/repos/benbaptist/minecraft-wrapper/issues/75","id":70933076,"user":{"login":"benbaptist","id":353809,"avatar_url":"https://avatars.githubusercontent.com/u/353809?v=3","gravatar_id":"","url":"https://api.github.com/users/benbaptist","html_url":"https://github.com/benbaptist","followers_url":"https://api.github.com/users/benbaptist/followers","following_url":"https://api.github.com/users/benbaptist/following{/other_user}","gists_url":"https://api.github.com/users/benbaptist/gists{/gist_id}","starred_url":"https://api.github.com/users/benbaptist/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benbaptist/subscriptions","organizations_url":"https://api.github.com/users/benbaptist/orgs","repos_url":"https://api.github.com/users/benbaptist/repos","events_url":"https://api.github.com/users/benbaptist/events{/privacy}","received_events_url":"https://api.github.com/users/benbaptist/received_events","type":"User","site_admin":false},"created_at":"2015-01-21T22:17:00Z","updated_at":"2015-01-21T22:17:00Z","body":"You will get 4f953255-6775-4dc6-a612-fb4230588eff. Inside of the UUID class, they defined an internal function called __str__. When someone tries to str() their class, it'll call __str__ and whatever __str__ returns, is what the string is made from. Because of that, in this case, it's smart enough to know '4f953255-6775-4dc6-a612-fb4230588eff' is what should be returned, not anything weird like UUID('4f953255-6775-4dc6-a612-fb4230588eff')."}}