{"action":"created","issue":{"url":"https://api.github.com/repos/houtianze/bypy/issues/258","repository_url":"https://api.github.com/repos/houtianze/bypy","labels_url":"https://api.github.com/repos/houtianze/bypy/issues/258/labels{/name}","comments_url":"https://api.github.com/repos/houtianze/bypy/issues/258/comments","events_url":"https://api.github.com/repos/houtianze/bypy/issues/258/events","html_url":"https://github.com/houtianze/bypy/pull/258","id":158054448,"number":258,"title":"Fix `TypeError: b'xxxxxx' is not JSON serializable`","user":{"login":"wangjiezhe","id":5236768,"avatar_url":"https://avatars.githubusercontent.com/u/5236768?v=3","gravatar_id":"","url":"https://api.github.com/users/wangjiezhe","html_url":"https://github.com/wangjiezhe","followers_url":"https://api.github.com/users/wangjiezhe/followers","following_url":"https://api.github.com/users/wangjiezhe/following{/other_user}","gists_url":"https://api.github.com/users/wangjiezhe/gists{/gist_id}","starred_url":"https://api.github.com/users/wangjiezhe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wangjiezhe/subscriptions","organizations_url":"https://api.github.com/users/wangjiezhe/orgs","repos_url":"https://api.github.com/users/wangjiezhe/repos","events_url":"https://api.github.com/users/wangjiezhe/events{/privacy}","received_events_url":"https://api.github.com/users/wangjiezhe/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-06-02T03:54:36Z","updated_at":"2016-06-15T04:05:31Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/houtianze/bypy/pulls/258","html_url":"https://github.com/houtianze/bypy/pull/258","diff_url":"https://github.com/houtianze/bypy/pull/258.diff","patch_url":"https://github.com/houtianze/bypy/pull/258.patch"},"body":"When I run upload/syncup in python3, it gives me something like\r\n\r\n```\r\n<E> [10:53:00] Failed to save Hash Cache.\r\nException:\r\n<class 'TypeError'> - b'52476ea8c296992547087e1f04239698' is not JSON serializable\r\nStack:\r\n  File \"./bypy.py\", line 4418, in <module>\r\n    main()\r\n  File \"./bypy.py\", line 4415, in main\r\n    onexit(result)\r\n  File \"./bypy.py\", line 4191, in onexit\r\n    cached.savecache()\r\n  File \"./bypy.py\", line 1006, in savecache\r\n    perr(\"Failed to save Hash Cache.\\n{}\".format(formatex(ex)))\r\n  File \"./bypy.py\", line 485, in formatex\r\n    type(ex), ex, ''.join(traceback.format_stack()))\r\n```\r\n\r\nUsing hashlib.hexdigest instead of hashlib.digest can avoid this problem.\r\n\r\nThe reason is that in python2, hashlib.digest returns str, but in python3, hashlib.digest returns bytes.\r\nHowever, hashlib.hexdigest returns str in both python2 and python3."},"comment":{"url":"https://api.github.com/repos/houtianze/bypy/issues/comments/226082812","html_url":"https://github.com/houtianze/bypy/pull/258#issuecomment-226082812","issue_url":"https://api.github.com/repos/houtianze/bypy/issues/258","id":226082812,"user":{"login":"houtianze","id":99046,"avatar_url":"https://avatars.githubusercontent.com/u/99046?v=3","gravatar_id":"","url":"https://api.github.com/users/houtianze","html_url":"https://github.com/houtianze","followers_url":"https://api.github.com/users/houtianze/followers","following_url":"https://api.github.com/users/houtianze/following{/other_user}","gists_url":"https://api.github.com/users/houtianze/gists{/gist_id}","starred_url":"https://api.github.com/users/houtianze/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houtianze/subscriptions","organizations_url":"https://api.github.com/users/houtianze/orgs","repos_url":"https://api.github.com/users/houtianze/repos","events_url":"https://api.github.com/users/houtianze/events{/privacy}","received_events_url":"https://api.github.com/users/houtianze/received_events","type":"User","site_admin":false},"created_at":"2016-06-15T04:05:31Z","updated_at":"2016-06-15T04:05:31Z","body":"Great :+1: , thanks for the good-illustrating example, I think now I get your point, will go through a bit and merge. Sigh, Unicode in Python sometimes is a pita..."}}
{"actor":{"display_login":"houtianze"}}