)]}'
{"swift/common/utils.py":[{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"4cd04b54fa5daa5344237b59dd090c660f236c4c","unresolved":true,"context_lines":[{"line_number":5788,"context_line":"    :returns: partition number"},{"line_number":5789,"context_line":"    \"\"\""},{"line_number":5790,"context_line":"    raw_hash \u003d binascii.unhexlify(hex_hash)"},{"line_number":5791,"context_line":"    part_shift \u003d 32 - int(part_power)"},{"line_number":5792,"context_line":"    return struct.unpack_from(\u0027\u003eI\u0027, raw_hash)[0] \u003e\u003e part_shift"},{"line_number":5793,"context_line":""},{"line_number":5794,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"0bf2ae15_f981fd81","line":5791,"range":{"start_line":5791,"start_character":22,"end_line":5791,"end_character":25},"updated":"2021-03-19 05:53:51.000000000","message":"Is this ever *not* an int?? That seems like a bug waiting to happen if so...","commit_id":"419a8ae8acb25b95afddd9571b3715edc9b4cc6b"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"4cd04b54fa5daa5344237b59dd090c660f236c4c","unresolved":true,"context_lines":[{"line_number":5789,"context_line":"    \"\"\""},{"line_number":5790,"context_line":"    raw_hash \u003d binascii.unhexlify(hex_hash)"},{"line_number":5791,"context_line":"    part_shift \u003d 32 - int(part_power)"},{"line_number":5792,"context_line":"    return struct.unpack_from(\u0027\u003eI\u0027, raw_hash)[0] \u003e\u003e part_shift"},{"line_number":5793,"context_line":""},{"line_number":5794,"context_line":""},{"line_number":5795,"context_line":"def replace_partition_in_path(path, part_power):"}],"source_content_type":"text/x-python","patch_set":3,"id":"e8f8a730_d1aaa574","line":5792,"range":{"start_line":5792,"start_character":11,"end_line":5792,"end_character":29},"updated":"2021-03-19 05:53:51.000000000","message":"I know this is all pre-existing, but I wonder if something like\n\n if len(hex_hash) \u003c 8:\n     raise ValueError\n return int(hex_hash[:8], 16) \u003e\u003e part_shift\n\nwould be simpler/more obvious than this unhexlify/unpack business...","commit_id":"419a8ae8acb25b95afddd9571b3715edc9b4cc6b"}],"test/unit/obj/test_diskfile.py":[{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"d304a7606e8ae0d03d91dce81ed48baf375a8e31","unresolved":true,"context_lines":[{"line_number":285,"context_line":"        os.symlink(target_path, new_target_dir)"},{"line_number":286,"context_line":"        with self.assertRaises(OSError) as cm:"},{"line_number":287,"context_line":"            diskfile.relink_paths(target_path, new_target_path)"},{"line_number":288,"context_line":"        self.assertEqual(errno.ENOTDIR, cm.exception.errno)"},{"line_number":289,"context_line":""},{"line_number":290,"context_line":"    def test_relink_paths_os_link_error(self):"},{"line_number":291,"context_line":"        target_dir \u003d os.path.join(self.testdir, \u0027d1\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"9e996908_f04a7108","line":288,"updated":"2021-03-03 19:11:06.000000000","message":"Right, and these ENOTDIRs are coming up out of the makedirs call; they\u0027d be EEXIST if it was that the new target existed but wasn\u0027t a link to the target.","commit_id":"9d539b6f0f6c3c8407c0808a909cda6b4afdc3b8"}],"test/unit/obj/test_server.py":[{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"b7e8463e4df2daf7db6dcab9980c599bc2ea40c8","unresolved":true,"context_lines":[{"line_number":2896,"context_line":"        calls \u003d []"},{"line_number":2897,"context_line":"        orig_makedirs \u003d os.makedirs"},{"line_number":2898,"context_line":""},{"line_number":2899,"context_line":"        def mock_makedirs(path, *args):"},{"line_number":2900,"context_line":"            # let another request catch up just as the first is about to create"},{"line_number":2901,"context_line":"            # the next part power object dir, then pretend the first request"},{"line_number":2902,"context_line":"            # process actually makes the dir"}],"source_content_type":"text/x-python","patch_set":2,"id":"f2391d97_3161726c","line":2899,"updated":"2021-03-05 05:29:02.000000000","message":"This needs a **kwargs:\n\n  def mock_makedirs(path, *args, **kwargs):\n\nAs in py3 a keyword arg is passed to makedirs:\n\n  TypeError: mock_makedirs() got an unexpected keyword argument \u0027exist_ok\u0027\n\nWhen I add it locally it then passing py3 unit tests.","commit_id":"c134f967ba595116fbc6c0c2742d437abf775e1f"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"27fb77cc893a311574e91e426210463a1d35c89c","unresolved":true,"context_lines":[{"line_number":2896,"context_line":"        calls \u003d []"},{"line_number":2897,"context_line":"        orig_makedirs \u003d os.makedirs"},{"line_number":2898,"context_line":""},{"line_number":2899,"context_line":"        def mock_makedirs(path, *args):"},{"line_number":2900,"context_line":"            # let another request catch up just as the first is about to create"},{"line_number":2901,"context_line":"            # the next part power object dir, then pretend the first request"},{"line_number":2902,"context_line":"            # process actually makes the dir"}],"source_content_type":"text/x-python","patch_set":2,"id":"e70509b8_f9ba6bf1","line":2899,"in_reply_to":"f2391d97_3161726c","updated":"2021-03-05 11:10:26.000000000","message":"Thanks!","commit_id":"c134f967ba595116fbc6c0c2742d437abf775e1f"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"4cd04b54fa5daa5344237b59dd090c660f236c4c","unresolved":true,"context_lines":[{"line_number":2908,"context_line":"                if len(calls) \u003d\u003d 2:"},{"line_number":2909,"context_line":"                    # pretend \u0027yield\u0027 back to first request process for"},{"line_number":2910,"context_line":"                    # its call to makedirs"},{"line_number":2911,"context_line":"                    orig_makedirs(calls[0])"},{"line_number":2912,"context_line":"            return orig_makedirs(path, *args, **kwargs)"},{"line_number":2913,"context_line":"        with mock.patch(\u0027swift.obj.diskfile.os.makedirs\u0027, mock_makedirs):"},{"line_number":2914,"context_line":"            make_request(ts_1)"}],"source_content_type":"text/x-python","patch_set":3,"id":"f4b4c97e_bbd5be4e","line":2911,"updated":"2021-03-19 05:53:51.000000000","message":"make_request won\u0027t return until the second request terminates, right? So for both the first and second request, the new_part hashdir will already be created?","commit_id":"419a8ae8acb25b95afddd9571b3715edc9b4cc6b"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"80af91b10644466ba092a674026a9d4f8dea74d9","unresolved":true,"context_lines":[{"line_number":2908,"context_line":"                if len(calls) \u003d\u003d 2:"},{"line_number":2909,"context_line":"                    # pretend \u0027yield\u0027 back to first request process for"},{"line_number":2910,"context_line":"                    # its call to makedirs"},{"line_number":2911,"context_line":"                    orig_makedirs(calls[0])"},{"line_number":2912,"context_line":"            return orig_makedirs(path, *args, **kwargs)"},{"line_number":2913,"context_line":"        with mock.patch(\u0027swift.obj.diskfile.os.makedirs\u0027, mock_makedirs):"},{"line_number":2914,"context_line":"            make_request(ts_1)"}],"source_content_type":"text/x-python","patch_set":3,"id":"2f8f53da_8d9f9965","line":2911,"in_reply_to":"f4b4c97e_bbd5be4e","updated":"2021-03-19 09:44:50.000000000","message":"yeah, I guess strictly there should be a return after line 2907\n\nhowever, I think the test does cover the race as intended, albeit with an extra call to orig_makedirs() when the first request proceeds","commit_id":"419a8ae8acb25b95afddd9571b3715edc9b4cc6b"}]}
