)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"78725635c9a6c93955004e67e9ec9fef166e25d9","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"ce04f724_09c4412d","updated":"2024-05-14 15:28:08.000000000","message":"these tests work on master currently:\n\n919595: tests: object_name normalization is tricky | https://review.opendev.org/c/openstack/python-swiftclient/+/919595\n\nI don\u0027t think we should break the behaviors in test_shell, and this change would.\n\n```\nFAILED python-swiftclient/test/unit/test_shell.py::TestShell::test_upload_hidden_file_by_name - AssertionError: [call[50 chars]\u003d{}), call.head_object(\u0027my_home_backup\u0027, \u0027.bas[130 chars]\u003d{})] !\u003d [call[50 chars]\u003d{}),\nFAILED python-swiftclient/test/unit/test_shell.py::TestShell::test_upload_hidden_file_in_current_dir - AssertionError: [call[30 chars] response_dict\u003d{}), call.head_object(\u0027tmp-test\u0027, \u0027.test-file\u0027)] !\u003d [call[30 chars] response_dict\u003d{}),\n```","commit_id":"e0e7881491c79f552de6207774f163f25460ba5c"}],"swiftclient/service.py":[{"author":{"_account_id":9216,"name":"Joel Wright","email":"joel.wright@gmail.com","username":"jjw-sohonet"},"change_message_id":"1e2f36c055d39008acdc87a0ededf219ef49ec80","unresolved":false,"context_lines":[{"line_number":289,"context_line":"        if not self.object_name:"},{"line_number":290,"context_line":"            raise SwiftError(\u0027Object names must not be empty strings\u0027)"},{"line_number":291,"context_line":""},{"line_number":292,"context_line":"        self.object_name \u003d self.object_name.lstrip(\u0027../\\\\\u0027)"},{"line_number":293,"context_line":"        self.options \u003d options"},{"line_number":294,"context_line":"        self.source \u003d source"},{"line_number":295,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"dae33548_04cb5473","line":292,"range":{"start_line":292,"start_character":8,"end_line":292,"end_character":12},"updated":"2016-02-16 15:52:14.000000000","message":"This isn\u0027t quite the right use of strip. Multiple \u0027.\u0027s in the strip make no difference (strip just removes all instances of the given characters until it finds on that doesn\u0027t match). It might be better to do something like:\n\n    self.object_name \u003d self.object_name.lstrip(\u0027.{0}\u0027.format(os.path.sep))","commit_id":"06644786d292bd76f04168ba99f3077bfd001973"},{"author":{"_account_id":10786,"name":"James Nzomo","email":"james@tdt.rocks","username":"moje"},"change_message_id":"e5727433dc46cadafd87a96b2550b0f16f2c9dad","unresolved":false,"context_lines":[{"line_number":289,"context_line":"        if not self.object_name:"},{"line_number":290,"context_line":"            raise SwiftError(\u0027Object names must not be empty strings\u0027)"},{"line_number":291,"context_line":""},{"line_number":292,"context_line":"        self.object_name \u003d self.object_name.lstrip(\u0027../\\\\\u0027)"},{"line_number":293,"context_line":"        self.options \u003d options"},{"line_number":294,"context_line":"        self.source \u003d source"},{"line_number":295,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"dae33548_481f265f","line":292,"range":{"start_line":292,"start_character":8,"end_line":292,"end_character":12},"in_reply_to":"dae33548_04cb5473","updated":"2016-02-16 18:09:44.000000000","message":"thanks for spotting that. I should have RTFMed [grand face-palm]\n\nOn the lstrip arg, maybe better to go with literal \u0027../\\\\\u0027 vs. os.pah.sep so it\u0027s simpler to test across platforms?","commit_id":"06644786d292bd76f04168ba99f3077bfd001973"},{"author":{"_account_id":9216,"name":"Joel Wright","email":"joel.wright@gmail.com","username":"jjw-sohonet"},"change_message_id":"1e2f36c055d39008acdc87a0ededf219ef49ec80","unresolved":false,"context_lines":[{"line_number":1505,"context_line":"        for o in objects:"},{"line_number":1506,"context_line":"            if isinstance(o, string_types):"},{"line_number":1507,"context_line":"                obj \u003d SwiftUploadObject(o, urljoin(pseudo_folder,"},{"line_number":1508,"context_line":"                                                   o.lstrip(\u0027../\\\\\u0027)))"},{"line_number":1509,"context_line":"                upload_objects.append(obj)"},{"line_number":1510,"context_line":"            elif isinstance(o, SwiftUploadObject):"},{"line_number":1511,"context_line":"                o.object_name \u003d urljoin(pseudo_folder, o.object_name)"}],"source_content_type":"text/x-python","patch_set":1,"id":"dae33548_64a180a3","line":1508,"range":{"start_line":1508,"start_character":53,"end_line":1508,"end_character":59},"updated":"2016-02-16 15:52:14.000000000","message":"See previous comment.","commit_id":"06644786d292bd76f04168ba99f3077bfd001973"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"78725635c9a6c93955004e67e9ec9fef166e25d9","unresolved":true,"context_lines":[{"line_number":358,"context_line":"        if not self.object_name:"},{"line_number":359,"context_line":"            raise SwiftError(\u0027Object names must not be empty strings\u0027)"},{"line_number":360,"context_line":""},{"line_number":361,"context_line":"        self.object_name \u003d self.object_name.lstrip(\u0027./\\\\\u0027)"},{"line_number":362,"context_line":"        self.options \u003d options"},{"line_number":363,"context_line":"        self.source \u003d source"},{"line_number":364,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"bf9123b2_59b04cef","line":361,"updated":"2024-05-14 15:28:08.000000000","message":"this part is untested; worse I\u0027m not sure it\u0027s correct?\n\nHow do I create an object named \".bashrc\" in a container \"my_home_backup\"?\n\nProbaby we should only do this kind of normalization when the object_name comes from source - if it\u0027s passed in explicitly we should just allow it.","commit_id":"e0e7881491c79f552de6207774f163f25460ba5c"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"78725635c9a6c93955004e67e9ec9fef166e25d9","unresolved":true,"context_lines":[{"line_number":1691,"context_line":"        for o in objects:"},{"line_number":1692,"context_line":"            if isinstance(o, str):"},{"line_number":1693,"context_line":"                obj \u003d SwiftUploadObject(o, urljoin(pseudo_folder,"},{"line_number":1694,"context_line":"                                                   o.lstrip(\u0027./\\\\\u0027)))"},{"line_number":1695,"context_line":"                upload_objects.append(obj)"},{"line_number":1696,"context_line":"            elif isinstance(o, SwiftUploadObject):"},{"line_number":1697,"context_line":"                o.object_name \u003d urljoin(pseudo_folder, o.object_name)"}],"source_content_type":"text/x-python","patch_set":3,"id":"43401eeb_07e84c26","line":1694,"updated":"2024-05-14 15:28:08.000000000","message":"the behavior with \"\\\" is untested","commit_id":"e0e7881491c79f552de6207774f163f25460ba5c"}],"test/unit/test_service.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"78725635c9a6c93955004e67e9ec9fef166e25d9","unresolved":true,"context_lines":[{"line_number":2162,"context_line":"            ((\u0027../../grand/relative/file/path\u0027,), \u0027/pseudo/dir\u0027): ["},{"line_number":2163,"context_line":"                \u0027pseudo/dir/grand/relative/file/path\u0027],"},{"line_number":2164,"context_line":"            ((\u0027./dir-in-curr-dir/relative/file/path\u0027,), \u0027pseudo/dir\u0027): ["},{"line_number":2165,"context_line":"                \u0027pseudo/dir/dir-in-curr-dir/relative/file/path\u0027],"},{"line_number":2166,"context_line":"        }"},{"line_number":2167,"context_line":"        errors \u003d []"},{"line_number":2168,"context_line":"        for (filenames, pseudo_folder), expected in \\"}],"source_content_type":"text/x-python","patch_set":3,"id":"cd658f62_a9705f9c","line":2165,"updated":"2024-05-14 15:28:08.000000000","message":"with the change reverted these tests fail like this:\n\n\tE       ERRORS:\n\tE       given ((\u0027../parent-relative/file/path\u0027,), \u0027pseudo/dir\u0027) expected [\u0027pseudo/dir/parent-relative/file/path\u0027], got Lists differ: [\u0027pseudo/dir/parent-relative/file/path\u0027] !\u003d [\u0027pseudo/dir/../parent-relative/file/path\u0027]\n\tE       \n\tE       First differing element 0:\n\tE       \u0027pseudo/dir/parent-relative/file/path\u0027\n\tE       \u0027pseudo/dir/../parent-relative/file/path\u0027\n\tE       \n\tE       - [\u0027pseudo/dir/parent-relative/file/path\u0027]\n\tE       + [\u0027pseudo/dir/../parent-relative/file/path\u0027]\n\tE       ?             +++\n\tE       \n\tE       given ((\u0027../../grand/relative/file/path\u0027,), \u0027/pseudo/dir\u0027) expected [\u0027pseudo/dir/grand/relative/file/path\u0027], got Lists differ: [\u0027pseudo/dir/grand/relative/file/path\u0027] !\u003d [\u0027pseudo/dir/../../grand/relative/file/path\u0027]\n\tE       \n\tE       First differing element 0:\n\tE       \u0027pseudo/dir/grand/relative/file/path\u0027\n\tE       \u0027pseudo/dir/../../grand/relative/file/path\u0027\n\tE       \n\tE       - [\u0027pseudo/dir/grand/relative/file/path\u0027]\n\tE       + [\u0027pseudo/dir/../../grand/relative/file/path\u0027]\n\tE       ?             ++++++\n\tE       \n\tE       given ((\u0027./dir-in-curr-dir/relative/file/path\u0027,), \u0027pseudo/dir\u0027) expected [\u0027pseudo/dir/dir-in-curr-dir/relative/file/path\u0027], got Lists differ: [\u0027pseudo/dir/dir-in-curr-dir/relative/file/path\u0027] !\u003d [\u0027pseudo/dir/./dir-in-curr-dir/relative/file/path\u0027]\n\tE       \n\tE       First differing element 0:\n\tE       \u0027pseudo/dir/dir-in-curr-dir/relative/file/path\u0027\n\tE       \u0027pseudo/dir/./dir-in-curr-dir/relative/file/path\u0027\n\tE       \n\tE       - [\u0027pseudo/dir/dir-in-curr-dir/relative/file/path\u0027]\n\tE       + [\u0027pseudo/dir/./dir-in-curr-dir/relative/file/path\u0027]\n\tE       ?             ++","commit_id":"e0e7881491c79f552de6207774f163f25460ba5c"}],"tests/unit/test_service.py":[{"author":{"_account_id":9216,"name":"Joel Wright","email":"joel.wright@gmail.com","username":"jjw-sohonet"},"change_message_id":"1e2f36c055d39008acdc87a0ededf219ef49ec80","unresolved":false,"context_lines":[{"line_number":1353,"context_line":"            ((\u0027relative/file/path\u0027,), \u0027relative/pseudo/dir\u0027): ["},{"line_number":1354,"context_line":"                \u0027relative/pseudo/dir/relative/file/path\u0027],"},{"line_number":1355,"context_line":"            ((\u0027../parent-relative/file/path\u0027,), \u0027pseudo/dir\u0027): ["},{"line_number":1356,"context_line":"                \u0027pseudo/dir/parent-relative/file/path\u0027],"},{"line_number":1357,"context_line":"        }"},{"line_number":1358,"context_line":"        errors \u003d []"},{"line_number":1359,"context_line":"        for (filenames, pseudo_folder), expected in \\"}],"source_content_type":"text/x-python","patch_set":1,"id":"dae33548_24d3f805","line":1356,"range":{"start_line":1356,"start_character":0,"end_line":1356,"end_character":16},"updated":"2016-02-16 15:52:14.000000000","message":"Some more examples with more complex relative paths might also be useful.\n\n    \u0027../../\u003cdir\u003e\u0027, \u0027./\u003cfile\u003e\u0027","commit_id":"06644786d292bd76f04168ba99f3077bfd001973"},{"author":{"_account_id":10786,"name":"James Nzomo","email":"james@tdt.rocks","username":"moje"},"change_message_id":"e5727433dc46cadafd87a96b2550b0f16f2c9dad","unresolved":false,"context_lines":[{"line_number":1353,"context_line":"            ((\u0027relative/file/path\u0027,), \u0027relative/pseudo/dir\u0027): ["},{"line_number":1354,"context_line":"                \u0027relative/pseudo/dir/relative/file/path\u0027],"},{"line_number":1355,"context_line":"            ((\u0027../parent-relative/file/path\u0027,), \u0027pseudo/dir\u0027): ["},{"line_number":1356,"context_line":"                \u0027pseudo/dir/parent-relative/file/path\u0027],"},{"line_number":1357,"context_line":"        }"},{"line_number":1358,"context_line":"        errors \u003d []"},{"line_number":1359,"context_line":"        for (filenames, pseudo_folder), expected in \\"}],"source_content_type":"text/x-python","patch_set":1,"id":"dae33548_c8a6960f","line":1356,"range":{"start_line":1356,"start_character":0,"end_line":1356,"end_character":16},"in_reply_to":"dae33548_24d3f805","updated":"2016-02-16 18:09:44.000000000","message":"right","commit_id":"06644786d292bd76f04168ba99f3077bfd001973"}]}
