)]}'
{"swift/common/middleware/s3api/s3checksum.py":[{"author":{"_account_id":34930,"name":"Jianjian Huo","email":"jhuo@nvidia.com","username":"jhuo"},"change_message_id":"8f6cd49e11b4d04d0eca8111e81c13f36be4b053","unresolved":true,"context_lines":[{"line_number":47,"context_line":"    except KeyError:"},{"line_number":48,"context_line":"        # We don\u0027t want to import s3response in this module"},{"line_number":49,"context_line":"        # so we cannot raise S3NotImplemented here."},{"line_number":50,"context_line":"        raise NotImplementedError("},{"line_number":51,"context_line":"            \u0027The %s algorithm is not supported.\u0027 % header)"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"94a98450_6c657462","line":50,"updated":"2026-10-15 17:17:56.000000000","message":"this has became unreachable, since every caller of ``get_checksum_hasher`` rejects unknown x-amz-checksum-* names with InvalidRequest (a 400) before calling ``get_checksum_hasher``. So the only way to reach the KeyError branch is for a future caller to skip that validation, which will be a mistake in Swift.\n\nwe could remove it, so this function just do\n```\ndef get_checksum_hasher(header):\n    \"\"\"\n    Return a checksum hasher for an x-amz-checksum-* header.\n\n    :raises KeyError: if the header does not name a supported algorithm.\n    \"\"\"\n    return CHECKSUMS_BY_HEADER[header]()\n```\n\nand then update ``test_get_checksum_hasher_invalid`` to ``assertRaises(KeyError)``\n```\ndef test_get_checksum_hasher_invalid(self):\n    # the algorithm is not recognised\n    def do_test(crc):\n        with self.assertRaises(KeyError):\n            get_checksum_hasher(\u0027x-amz-checksum-%s\u0027 % crc)\n\n    do_test(\u0027nonsense\u0027)\n    do_test(\u0027\u0027)\n```","commit_id":"c6be747926fb51d0829aa36de597dca558ab18c2"},{"author":{"_account_id":34930,"name":"Jianjian Huo","email":"jhuo@nvidia.com","username":"jhuo"},"change_message_id":"758a958e339ed12da15fbed05032305f7b27e0a9","unresolved":false,"context_lines":[{"line_number":47,"context_line":"    except KeyError:"},{"line_number":48,"context_line":"        # We don\u0027t want to import s3response in this module"},{"line_number":49,"context_line":"        # so we cannot raise S3NotImplemented here."},{"line_number":50,"context_line":"        raise NotImplementedError("},{"line_number":51,"context_line":"            \u0027The %s algorithm is not supported.\u0027 % header)"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"0b619b39_3db085e7","line":50,"in_reply_to":"52144637_ba78bdf7","updated":"2026-10-16 03:56:12.000000000","message":"Done","commit_id":"c6be747926fb51d0829aa36de597dca558ab18c2"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"064bc8a41d33760b71234fde8c9d074cac8ca746","unresolved":true,"context_lines":[{"line_number":47,"context_line":"    except KeyError:"},{"line_number":48,"context_line":"        # We don\u0027t want to import s3response in this module"},{"line_number":49,"context_line":"        # so we cannot raise S3NotImplemented here."},{"line_number":50,"context_line":"        raise NotImplementedError("},{"line_number":51,"context_line":"            \u0027The %s algorithm is not supported.\u0027 % header)"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"52144637_ba78bdf7","line":50,"in_reply_to":"94a98450_6c657462","updated":"2026-10-15 17:53:30.000000000","message":"I like that idea 👍","commit_id":"c6be747926fb51d0829aa36de597dca558ab18c2"}],"test/unit/common/middleware/s3api/test_s3checksum.py":[{"author":{"_account_id":34930,"name":"Jianjian Huo","email":"jhuo@nvidia.com","username":"jhuo"},"change_message_id":"8f6cd49e11b4d04d0eca8111e81c13f36be4b053","unresolved":true,"context_lines":[{"line_number":141,"context_line":"        self._check_hasher(\u0027sha256\u0027)"},{"line_number":142,"context_line":""},{"line_number":143,"context_line":"    @requires_crc32c"},{"line_number":144,"context_line":"    def test_get_checksum_hasher_crc32c(self):"},{"line_number":145,"context_line":"        self._check_hasher(\u0027crc32c\u0027)"},{"line_number":146,"context_line":""},{"line_number":147,"context_line":"    @requires_crc64nvme"}],"source_content_type":"text/x-python","patch_set":1,"id":"d2b2a340_f5402034","side":"PARENT","line":144,"updated":"2026-10-15 17:17:56.000000000","message":"test_get_checksum_hasher_crc32c and test_get_checksum_hasher_crc64nvme could be merged into\n\n```\ndef test_get_checksum_hasher(self):\n    for algo in (\u0027crc32\u0027, \u0027crc32c\u0027, \u0027crc64nvme\u0027, \u0027sha1\u0027, \u0027sha256\u0027):\n        self._check_hasher(algo)\n```","commit_id":"ad136f5b5656f30bdf0716b9ac7966c475b23780"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"064bc8a41d33760b71234fde8c9d074cac8ca746","unresolved":true,"context_lines":[{"line_number":141,"context_line":"        self._check_hasher(\u0027sha256\u0027)"},{"line_number":142,"context_line":""},{"line_number":143,"context_line":"    @requires_crc32c"},{"line_number":144,"context_line":"    def test_get_checksum_hasher_crc32c(self):"},{"line_number":145,"context_line":"        self._check_hasher(\u0027crc32c\u0027)"},{"line_number":146,"context_line":""},{"line_number":147,"context_line":"    @requires_crc64nvme"}],"source_content_type":"text/x-python","patch_set":1,"id":"ddbf9bde_41b18c54","side":"PARENT","line":144,"in_reply_to":"d2b2a340_f5402034","updated":"2026-10-15 17:53:30.000000000","message":"Sure. I\u0027d do it as either\n```\n    def test_get_checksum_hasher(self):\n        self._check_hasher(\u0027crc32\u0027)\n        self._check_hasher(\u0027crc32c\u0027)\n        self._check_hasher(\u0027crc64nvme\u0027)\n        self._check_hasher(\u0027sha1\u0027)\n        self._check_hasher(\u0027sha256\u0027)\n```\nor\n```\n    def test_get_checksum_hasher(self):\n        for algo in (\u0027crc32\u0027, \u0027crc32c\u0027, \u0027crc64nvme\u0027, \u0027sha1\u0027, \u0027sha256\u0027):\n            with self.subTest(algo\u003dalgo):\n                self._check_hasher(algo)\n```\nthough. If we like the latter, we could probably even get rid of the `_check_hasher` helper:\n```\n    def test_get_checksum_hasher(self):\n        for algo in (\u0027crc32\u0027, \u0027crc32c\u0027, \u0027crc64nvme\u0027, \u0027sha1\u0027, \u0027sha256\u0027):\n            with self.subTest(algo\u003dalgo):\n                hasher \u003d get_checksum_hasher(\u0027x-amz-checksum-%s\u0027 % algo)\n                self.assertEqual(algo, hasher.name)\n```","commit_id":"ad136f5b5656f30bdf0716b9ac7966c475b23780"},{"author":{"_account_id":34930,"name":"Jianjian Huo","email":"jhuo@nvidia.com","username":"jhuo"},"change_message_id":"758a958e339ed12da15fbed05032305f7b27e0a9","unresolved":false,"context_lines":[{"line_number":141,"context_line":"        self._check_hasher(\u0027sha256\u0027)"},{"line_number":142,"context_line":""},{"line_number":143,"context_line":"    @requires_crc32c"},{"line_number":144,"context_line":"    def test_get_checksum_hasher_crc32c(self):"},{"line_number":145,"context_line":"        self._check_hasher(\u0027crc32c\u0027)"},{"line_number":146,"context_line":""},{"line_number":147,"context_line":"    @requires_crc64nvme"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a973ed7_fb397aa8","side":"PARENT","line":144,"in_reply_to":"ddbf9bde_41b18c54","updated":"2026-10-16 03:56:12.000000000","message":"Done","commit_id":"ad136f5b5656f30bdf0716b9ac7966c475b23780"}]}
