)]}'
{"swift/common/utils.py":[{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"e0365a5f2d1c88f9145b599611a29b51c3512c55","unresolved":false,"context_lines":[{"line_number":649,"context_line":""},{"line_number":650,"context_line":"    def __new__(cls, data, method, salt):"},{"line_number":651,"context_line":"        method \u003d method.lower()"},{"line_number":652,"context_line":"        if method not in getattr(hashlib, \u0027algorithms_guaranteed\u0027, {\u0027md5\u0027}):"},{"line_number":653,"context_line":"            raise ValueError(\u0027Unsupported hashing method: %r\u0027 % method)"},{"line_number":654,"context_line":"        s \u003d str.__new__(cls, data or \u0027\u0027)"},{"line_number":655,"context_line":"        s.method \u003d method"}],"source_content_type":"text/x-python","patch_set":1,"id":"9fb8cfa7_252c0e46","line":652,"range":{"start_line":652,"start_character":69,"end_line":652,"end_character":72},"updated":"2019-06-06 19:37:19.000000000","message":"Python\u0027s docs say\n\n\u003e Constructors for hash algorithms that are always present in this module are md5(), sha1(), sha224(), sha256(), sha384(), and sha512().\n\nSeems to be true since the beginning of py27? https://github.com/python/cpython/blob/v2.7/Lib/hashlib.py#L59\n\nMakes me a little annoyed that hashlib.algorithms isn\u0027t a thing on py3 or we could just use that :-/\n\nIs\n\n if method not in (hashlib.algorithms if six.PY2\n                   else hashlib.algorithms_guaranteed):\n\ncrazy?","commit_id":"8cf20617a4997684d9c46818cfba78807f68ba77"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"0aade0d57e40041beee97ecd1e54881248a4fbe2","unresolved":false,"context_lines":[{"line_number":649,"context_line":""},{"line_number":650,"context_line":"    def __new__(cls, data, method, salt):"},{"line_number":651,"context_line":"        method \u003d method.lower()"},{"line_number":652,"context_line":"        if method not in getattr(hashlib, \u0027algorithms_guaranteed\u0027, {\u0027md5\u0027}):"},{"line_number":653,"context_line":"            raise ValueError(\u0027Unsupported hashing method: %r\u0027 % method)"},{"line_number":654,"context_line":"        s \u003d str.__new__(cls, data or \u0027\u0027)"},{"line_number":655,"context_line":"        s.method \u003d method"}],"source_content_type":"text/x-python","patch_set":1,"id":"9fb8cfa7_85adba89","line":652,"range":{"start_line":652,"start_character":69,"end_line":652,"end_character":72},"in_reply_to":"9fb8cfa7_252c0e46","updated":"2019-06-06 19:43:58.000000000","message":"no i think that looks great!  #willfix","commit_id":"8cf20617a4997684d9c46818cfba78807f68ba77"}],"test/unit/common/test_utils.py":[{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"3d38c568c4a5de490074a4e3e4a37fa9fd84cbc0","unresolved":false,"context_lines":[{"line_number":3567,"context_line":""},{"line_number":3568,"context_line":"    def test_str_anonymizer_old_python2(self):"},{"line_number":3569,"context_line":"        with mock.patch(\u0027swift.common.utils.hashlib\u0027) as mockhashlib:"},{"line_number":3570,"context_line":"            mockhashlib.algorithms \u003d hashlib.algorithms"},{"line_number":3571,"context_line":"            # python \u003c2.7.9 doesn\u0027t have this algorithms_guaranteed, but our if"},{"line_number":3572,"context_line":"            # block short-circuts before we explode"},{"line_number":3573,"context_line":"            mockhashlib.algorithms_guaranteed.sideEffect \u003d AttributeError()"}],"source_content_type":"text/x-python","patch_set":2,"id":"9fb8cfa7_d42281a4","line":3570,"range":{"start_line":3570,"start_character":37,"end_line":3570,"end_character":55},"updated":"2019-06-07 15:25:03.000000000","message":"I don\u0027t think this\u0027ll pass on py3... maybe we could do something like\n\n def do_test():\n     ...\n if six.PY2:\n     with mock.patch.object(hashlib, \u0027algorithms_guaranteed\u0027):\n         # python \u003c2.7.9 doesn\u0027t have this .algorithms_guaranteed,\n         # but all of 2.7.x *does* have .algorithms\n         del hashlib.algorithms_guaranteed\n         do_test()\n else:\n     do_test()\n\ninstead? Maybe even add a\n\n     with self.assertRaises(AttributeError):\n         hashlib.algorithms\n\nin the py3 branch...","commit_id":"5dbf71eef215ee95fef6c076e6c00409963d2980"}]}
