)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"b1dff68d9f53e9610b9111c73a1765a2680aaeaa","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"538a6f8d_5a905484","updated":"2024-10-03 23:38:23.000000000","message":"I don\u0027t know what those bogus functests were from","commit_id":"eb8fdb5e69c27811269b2ab6061f95f120f6ed11"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"c2f640497ef549e0bd0620cd84920ea2ff9c3001","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"74e97fb4_b3a3ac19","updated":"2024-08-27 17:45:30.000000000","message":"Maybe I could squash in everything *but* the func test changes?","commit_id":"eb8fdb5e69c27811269b2ab6061f95f120f6ed11"}],"swiftclient/client.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"b1dff68d9f53e9610b9111c73a1765a2680aaeaa","unresolved":true,"context_lines":[{"line_number":1962,"context_line":"            reset_func \u003d None"},{"line_number":1963,"context_line":"        else:"},{"line_number":1964,"context_line":"            if hasattr(contents, \u0027read\u0027) and not isinstance("},{"line_number":1965,"context_line":"                    contents, LengthWrapper):"},{"line_number":1966,"context_line":"                if content_length is None:"},{"line_number":1967,"context_line":"                    contents \u003d ReadableToIterable("},{"line_number":1968,"context_line":"                        contents, chunk_size or 65536, md5\u003dFalse)"}],"source_content_type":"text/x-python","patch_set":2,"id":"11f949cd_1f96e459","line":1965,"updated":"2024-10-03 23:38:23.000000000","message":"the `and not isinstance(LengthWraper)` smells wrong to me; we should be able to duck-type this; I feel like this conditional is trying to do too much or in the wrong order.","commit_id":"eb8fdb5e69c27811269b2ab6061f95f120f6ed11"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"b1dff68d9f53e9610b9111c73a1765a2680aaeaa","unresolved":true,"context_lines":[{"line_number":1968,"context_line":"                        contents, chunk_size or 65536, md5\u003dFalse)"},{"line_number":1969,"context_line":"                else:"},{"line_number":1970,"context_line":"                    contents \u003d LengthWrapper("},{"line_number":1971,"context_line":"                        contents, content_length, md5\u003dFalse)"},{"line_number":1972,"context_line":"            try:"},{"line_number":1973,"context_line":"                reset_func \u003d contents.reset"},{"line_number":1974,"context_line":"            except AttributeError:"}],"source_content_type":"text/x-python","patch_set":2,"id":"1519631e_1ba59303","line":1971,"updated":"2024-10-03 23:38:23.000000000","message":"I feel like maybe put_object should be handling the \"readable with content_length needs to truncate\" - and that seems one layer removed from \"how to we handle reset\" (which is decidely a concern of the Connection)","commit_id":"eb8fdb5e69c27811269b2ab6061f95f120f6ed11"}],"swiftclient/utils.py":[{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"c2f640497ef549e0bd0620cd84920ea2ff9c3001","unresolved":true,"context_lines":[{"line_number":385,"context_line":""},{"line_number":386,"context_line":"    def _reset(self, *args, **kwargs):"},{"line_number":387,"context_line":"        if not self._can_reset:"},{"line_number":388,"context_line":"            raise TypeError(\u0027%r object cannot be reset; needs both seek and \u0027"},{"line_number":389,"context_line":"                            \u0027tell methods\u0027 % type(self._readable).__name__)"},{"line_number":390,"context_line":"        self.content.seek(self._start)"},{"line_number":391,"context_line":"        if not isinstance(self.md5sum, NoopMD5):"}],"source_content_type":"text/x-python","patch_set":2,"id":"a8ff0aba_1efb7e16","line":388,"updated":"2024-08-27 17:45:30.000000000","message":"OK, so a `ReadableToIterable(LengthWrapper(filelike))` cannot be reset even if the underlying `filelike` has `seek`\u0026`tell` (so a `LengthWrapper(filelike)` *could* be reset)...\n\nGood thing we\u0027ve got that `and not isinstance(contents, LengthWrapper)` check I guess!","commit_id":"eb8fdb5e69c27811269b2ab6061f95f120f6ed11"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"b1dff68d9f53e9610b9111c73a1765a2680aaeaa","unresolved":true,"context_lines":[{"line_number":385,"context_line":""},{"line_number":386,"context_line":"    def _reset(self, *args, **kwargs):"},{"line_number":387,"context_line":"        if not self._can_reset:"},{"line_number":388,"context_line":"            raise TypeError(\u0027%r object cannot be reset; needs both seek and \u0027"},{"line_number":389,"context_line":"                            \u0027tell methods\u0027 % type(self._readable).__name__)"},{"line_number":390,"context_line":"        self.content.seek(self._start)"},{"line_number":391,"context_line":"        if not isinstance(self.md5sum, NoopMD5):"}],"source_content_type":"text/x-python","patch_set":2,"id":"746b3ca6_accb6a59","line":388,"in_reply_to":"a8ff0aba_1efb7e16","updated":"2024-10-03 23:38:23.000000000","message":"\u003e  a ReadableToIterable(LengthWrapper(filelike)) cannot be reset\n\nWHY WOULD WE DO THAT!?  I\u0027m not sure I fully understand the usefulness of `ReadableToIterable`\n\n\u003e Good thing we\u0027ve got that and not isinstance(contents, LengthWrapper) check I guess!\n\nthat doesn\u0027t sound right.\n\n\u003e a ReadableToIterable(LengthWrapper(filelike)) cannot be reset\n\nso the `_can_reset` determination should be `hasattr(seek \u0026 tell) | is_callable(getattr(reset))` ???","commit_id":"eb8fdb5e69c27811269b2ab6061f95f120f6ed11"}],"test/functional/test_swiftclient.py":[{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"c2f640497ef549e0bd0620cd84920ea2ff9c3001","unresolved":true,"context_lines":[{"line_number":284,"context_line":"            contents\u003dself.test_data, etag\u003d\u0027invalid\u0027)"},{"line_number":285,"context_line":""},{"line_number":286,"context_line":"    def test_upload_non_ascii_string(self):"},{"line_number":287,"context_line":"        # Object with content from unicode are ok if they\u0027re latin-1"},{"line_number":288,"context_line":"        pound \u003d u\"\\u00A3\""},{"line_number":289,"context_line":"        self.conn.put_object("},{"line_number":290,"context_line":"            self.containername, self.objectname,"}],"source_content_type":"text/x-python","patch_set":2,"id":"e489f5ae_656b49da","line":287,"range":{"start_line":287,"start_character":50,"end_line":287,"end_character":68},"updated":"2024-08-27 17:45:30.000000000","message":"This seems like a misfeature -- I could see us dealing with ASCII (which was all we were testing with before), but picking any other encoding seems like asking for trouble.\n\nIs this supposed to be the current behavior on master? If so, would probably look better pulled ahead of the retry fix.","commit_id":"eb8fdb5e69c27811269b2ab6061f95f120f6ed11"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"b1dff68d9f53e9610b9111c73a1765a2680aaeaa","unresolved":true,"context_lines":[{"line_number":284,"context_line":"            contents\u003dself.test_data, etag\u003d\u0027invalid\u0027)"},{"line_number":285,"context_line":""},{"line_number":286,"context_line":"    def test_upload_non_ascii_string(self):"},{"line_number":287,"context_line":"        # Object with content from unicode are ok if they\u0027re latin-1"},{"line_number":288,"context_line":"        pound \u003d u\"\\u00A3\""},{"line_number":289,"context_line":"        self.conn.put_object("},{"line_number":290,"context_line":"            self.containername, self.objectname,"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a00c790_3f1a27e3","line":287,"range":{"start_line":287,"start_character":50,"end_line":287,"end_character":68},"in_reply_to":"e489f5ae_656b49da","updated":"2024-10-03 23:38:23.000000000","message":"IIRC it was current behavior (on legacy python?  which we don\u0027t support?) that I discovered and agree it seems wrong; but I\u0027m not able to duplicate.\n\nI\u0027ll try pulling the extra testing to the front.","commit_id":"eb8fdb5e69c27811269b2ab6061f95f120f6ed11"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"c2f640497ef549e0bd0620cd84920ea2ff9c3001","unresolved":true,"context_lines":[{"line_number":291,"context_line":"            contents\u003dpound)"},{"line_number":292,"context_line":"        hdrs \u003d self.conn.head_object(self.containername, self.objectname)"},{"line_number":293,"context_line":"        self.assertEqual(str(len(pound.encode(\u0027latin1\u0027))),"},{"line_number":294,"context_line":"                         hdrs.get(\u0027content-length\u0027))"},{"line_number":295,"context_line":"        expected \u003d hashlib.md5(pound.encode(\u0027latin1\u0027)).hexdigest()"},{"line_number":296,"context_line":"        self.assertEqual(expected, hdrs.get(\u0027etag\u0027).strip(\u0027\"\u0027))"},{"line_number":297,"context_line":"        self.assertEqual(\u0027application/octet-stream\u0027,"}],"source_content_type":"text/x-python","patch_set":2,"id":"90706166_6f5a82b2","line":294,"updated":"2024-08-27 17:45:30.000000000","message":"This fails OMM\n```\n_______________________ TestFunctional.test_upload_non_ascii_string ________________________\n\nself \u003d \u003ctest.functional.test_swiftclient.TestFunctional testMethod\u003dtest_upload_non_ascii_string\u003e\n\n    def test_upload_non_ascii_string(self):\n        # Object with content from unicode are ok if they\u0027re latin-1\n        pound \u003d u\"\\u00A3\"\n        self.conn.put_object(\n            self.containername, self.objectname,\n            contents\u003dpound)\n        hdrs \u003d self.conn.head_object(self.containername, self.objectname)\n\u003e       self.assertEqual(str(len(pound.encode(\u0027latin1\u0027))),\n                         hdrs.get(\u0027content-length\u0027))\nE       AssertionError: \u00271\u0027 !\u003d \u00272\u0027\nE       - 1\nE       + 2\n\ntest/functional/test_swiftclient.py:293: AssertionError\n```\nMaybe something with my requests/urllib3 versions?\n```\nvagrant@saio:~/python-swiftclient$ pip freeze | grep \u0027requests\\|urllib\u0027\nrequests\u003d\u003d2.32.3\nrequests-mock\u003d\u003d1.12.1\nrequestsexceptions\u003d\u003d1.4.0\nurllib3\u003d\u003d2.2.2\n```","commit_id":"eb8fdb5e69c27811269b2ab6061f95f120f6ed11"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"c2f640497ef549e0bd0620cd84920ea2ff9c3001","unresolved":true,"context_lines":[{"line_number":299,"context_line":""},{"line_number":300,"context_line":"        # It\u0027s probably better if clients give us bytes"},{"line_number":301,"context_line":"        snowman \u003d u\"\\u2603\""},{"line_number":302,"context_line":"        with self.assertRaises(UnicodeEncodeError) as e:"},{"line_number":303,"context_line":"            self.conn.put_object("},{"line_number":304,"context_line":"                self.containername, self.objectname,"},{"line_number":305,"context_line":"                contents\u003dsnowman)"}],"source_content_type":"text/x-python","patch_set":2,"id":"c307d651_ce56778f","line":302,"updated":"2024-08-27 17:45:30.000000000","message":"If I comment out the above (failing) assertions, this one pops\n```\n_______________________ TestFunctional.test_upload_non_ascii_string ________________________\n\nself \u003d \u003ctest.functional.test_swiftclient.TestFunctional testMethod\u003dtest_upload_non_ascii_string\u003e\n\n    def test_upload_non_ascii_string(self):\n        # Object with content from unicode are ok if they\u0027re latin-1\n        pound \u003d u\"\\u00A3\"\n        self.conn.put_object(\n            self.containername, self.objectname,\n            contents\u003dpound)\n        #hdrs \u003d self.conn.head_object(self.containername, self.objectname)\n        #self.assertEqual(str(len(pound.encode(\u0027latin1\u0027))),\n        #                 hdrs.get(\u0027content-length\u0027))\n        #expected \u003d hashlib.md5(pound.encode(\u0027latin1\u0027)).hexdigest()\n        #self.assertEqual(expected, hdrs.get(\u0027etag\u0027).strip(\u0027\"\u0027))\n        #self.assertEqual(\u0027application/octet-stream\u0027,\n        #                 hdrs.get(\u0027content-type\u0027))\n    \n        # It\u0027s probably better if clients give us bytes\n        snowman \u003d u\"\\u2603\"\n\u003e       with self.assertRaises(UnicodeEncodeError) as e:\nE       AssertionError: UnicodeEncodeError not raised\n\ntest/functional/test_swiftclient.py:302: AssertionError\n```","commit_id":"eb8fdb5e69c27811269b2ab6061f95f120f6ed11"}]}
