)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"f19b073e6c3e5fb12b62addd378ce43863953e1c","unresolved":false,"context_lines":[{"line_number":7,"context_line":"py3: port symlink middleware"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This patch ports the symlink middleware to py3."},{"line_number":10,"context_line":"The middlewre inself seemsa to be fine and all changes"},{"line_number":11,"context_line":"are in the symlink unit tests."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Change-Id: I973c2e1bb8969cf6bffece8ce68881c393efbaef"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"bfb3d3c7_3c845b5e","line":10,"range":{"start_line":10,"start_character":4,"end_line":10,"end_character":27},"updated":"2019-05-20 20:26:38.000000000","message":"nit: middleware itself seems\n\nAnd I guess we ought to switch \"all\" to \"most\" now ;-)","commit_id":"af38a489a2b9a514876c5ba1bfbc21f915ddeeb9"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"6ac7f7f11f925859dfba5712248584918291bac7","unresolved":false,"context_lines":[{"line_number":7,"context_line":"py3: port symlink middleware"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This patch ports the symlink middleware to py3."},{"line_number":10,"context_line":"The middlewre inself seemsa to be fine and all changes"},{"line_number":11,"context_line":"are in the symlink unit tests."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Change-Id: I973c2e1bb8969cf6bffece8ce68881c393efbaef"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"bfb3d3c7_18cd4330","line":10,"range":{"start_line":10,"start_character":4,"end_line":10,"end_character":27},"in_reply_to":"bfb3d3c7_3c845b5e","updated":"2019-05-30 08:08:31.000000000","message":"+1","commit_id":"af38a489a2b9a514876c5ba1bfbc21f915ddeeb9"}],"swift/common/middleware/symlink.py":[{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"f19b073e6c3e5fb12b62addd378ce43863953e1c","unresolved":false,"context_lines":[{"line_number":204,"context_line":"            raise HTTPPreconditionFailed("},{"line_number":205,"context_line":"                body\u003derror_body,"},{"line_number":206,"context_line":"                request\u003dreq, content_type\u003d\u0027text/plain\u0027)"},{"line_number":207,"context_line":"    except TypeError:"},{"line_number":208,"context_line":"        raise HTTPPreconditionFailed("},{"line_number":209,"context_line":"            body\u003derror_body,"},{"line_number":210,"context_line":"            request\u003dreq, content_type\u003d\u0027text/plain\u0027)"}],"source_content_type":"text/x-python","patch_set":3,"id":"bfb3d3c7_fca4830a","line":207,"range":{"start_line":207,"start_character":11,"end_line":207,"end_character":20},"updated":"2019-05-20 20:26:38.000000000","message":"Sure, the way tests are written, wsgi_unquote can raise a TypeError -- but that should never happen in a running system, right? I put those type checks in mostly to help me root out type errors in tests; I would *hope* we can trust eventlet to hand us sane environments...","commit_id":"af38a489a2b9a514876c5ba1bfbc21f915ddeeb9"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"6ac7f7f11f925859dfba5712248584918291bac7","unresolved":false,"context_lines":[{"line_number":223,"context_line":"    except TypeError:"},{"line_number":224,"context_line":"        raise HTTPPreconditionFailed("},{"line_number":225,"context_line":"            body\u003d\u0027Account name cannot contain slashes\u0027,"},{"line_number":226,"context_line":"            request\u003dreq, content_type\u003d\u0027text/plain\u0027)"},{"line_number":227,"context_line":""},{"line_number":228,"context_line":"    # Extract request path"},{"line_number":229,"context_line":"    _junk, req_acc, req_cont, req_obj \u003d req.split_path(4, 4, True)"}],"source_content_type":"text/x-python","patch_set":3,"id":"bfb3d3c7_a1072218","line":226,"updated":"2019-05-30 08:08:31.000000000","message":"This is same thing with the Tim\u0027s comment above. the TypeError will be caused by wsgi_unquote but I\u0027m not sure if it\u0027ll happen in the real case.","commit_id":"af38a489a2b9a514876c5ba1bfbc21f915ddeeb9"}],"test/unit/common/middleware/test_symlink.py":[{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"7fc134f09db98592749f9c6a54d371fa371c178b","unresolved":false,"context_lines":[{"line_number":409,"context_line":"        target \u003d u\u0027\\u30b0\\u30e9\\u30d6\\u30eb/\\u30a2\\u30ba\\u30ec\\u30f3\u0027"},{"line_number":410,"context_line":"        do_test("},{"line_number":411,"context_line":"            {\u0027X-Symlink-Target\u0027:"},{"line_number":412,"context_line":"             str_to_wsgi(target)})"},{"line_number":413,"context_line":"        encoded_target \u003d quote(target.encode(\u0027utf-8\u0027), \u0027\u0027)"},{"line_number":414,"context_line":"        do_test({\u0027X-Symlink-Target\u0027: encoded_target})"},{"line_number":415,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"bfb3d3c7_0fd057f7","line":412,"updated":"2019-05-18 01:33:09.000000000","message":"But it isn\u0027t a str on py2! :-(\n\nI guess we\u0027re relying on str_to_wsgi passing the unicode directly, and Request.blank doing the encoding for us on py2?","commit_id":"20a080e925ed402ecccb09b9e8d995d4bca2d003"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"7fc134f09db98592749f9c6a54d371fa371c178b","unresolved":false,"context_lines":[{"line_number":410,"context_line":"        do_test("},{"line_number":411,"context_line":"            {\u0027X-Symlink-Target\u0027:"},{"line_number":412,"context_line":"             str_to_wsgi(target)})"},{"line_number":413,"context_line":"        encoded_target \u003d quote(target.encode(\u0027utf-8\u0027), \u0027\u0027)"},{"line_number":414,"context_line":"        do_test({\u0027X-Symlink-Target\u0027: encoded_target})"},{"line_number":415,"context_line":""},{"line_number":416,"context_line":"        do_test("}],"source_content_type":"text/x-python","patch_set":2,"id":"bfb3d3c7_8fef6786","line":413,"updated":"2019-05-18 01:33:09.000000000","message":"I\u0027ve gotten rather leery (perhaps overly so) of stdlib\u0027s quote() -- what do we think about something like http://paste.openstack.org/show/751560/ ?","commit_id":"20a080e925ed402ecccb09b9e8d995d4bca2d003"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"2cf9dadae792e67394177c77ec12fd2e4bf4330f","unresolved":false,"context_lines":[{"line_number":410,"context_line":"        do_test("},{"line_number":411,"context_line":"            {\u0027X-Symlink-Target\u0027:"},{"line_number":412,"context_line":"             str_to_wsgi(target)})"},{"line_number":413,"context_line":"        encoded_target \u003d quote(target.encode(\u0027utf-8\u0027), \u0027\u0027)"},{"line_number":414,"context_line":"        do_test({\u0027X-Symlink-Target\u0027: encoded_target})"},{"line_number":415,"context_line":""},{"line_number":416,"context_line":"        do_test("}],"source_content_type":"text/x-python","patch_set":2,"id":"bfb3d3c7_878504b0","line":413,"in_reply_to":"bfb3d3c7_8fef6786","updated":"2019-05-20 06:22:18.000000000","message":"Done","commit_id":"20a080e925ed402ecccb09b9e8d995d4bca2d003"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"7fc134f09db98592749f9c6a54d371fa371c178b","unresolved":false,"context_lines":[{"line_number":415,"context_line":""},{"line_number":416,"context_line":"        do_test("},{"line_number":417,"context_line":"            {\u0027X-Symlink-Target\u0027: \u0027cont/obj\u0027,"},{"line_number":418,"context_line":"             \u0027X-Symlink-Target-Account\u0027: u\u0027\\u30b0\\u30e9\\u30d6\\u30eb\u0027})"},{"line_number":419,"context_line":""},{"line_number":420,"context_line":"    def test_check_symlink_header_invalid_format(self):"},{"line_number":421,"context_line":"        def do_test(headers, status, err_msg):"}],"source_content_type":"text/x-python","patch_set":2,"id":"bfb3d3c7_2f667bef","line":418,"updated":"2019-05-18 01:33:09.000000000","message":"Wait, this one didn\u0027t need to be str_to_wsgi()ed?\n\nMakes me thinks symlink probably *does* need changes; something along the lines of http://paste.openstack.org/show/751561/ as a start.","commit_id":"20a080e925ed402ecccb09b9e8d995d4bca2d003"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"2cf9dadae792e67394177c77ec12fd2e4bf4330f","unresolved":false,"context_lines":[{"line_number":415,"context_line":""},{"line_number":416,"context_line":"        do_test("},{"line_number":417,"context_line":"            {\u0027X-Symlink-Target\u0027: \u0027cont/obj\u0027,"},{"line_number":418,"context_line":"             \u0027X-Symlink-Target-Account\u0027: u\u0027\\u30b0\\u30e9\\u30d6\\u30eb\u0027})"},{"line_number":419,"context_line":""},{"line_number":420,"context_line":"    def test_check_symlink_header_invalid_format(self):"},{"line_number":421,"context_line":"        def do_test(headers, status, err_msg):"}],"source_content_type":"text/x-python","patch_set":2,"id":"bfb3d3c7_279218f8","line":418,"in_reply_to":"bfb3d3c7_2f667bef","updated":"2019-05-20 06:22:18.000000000","message":"Done\n\nBut needed to tweak the _check_symlink_header method to deal with wsgi_unquote typeerrors.","commit_id":"20a080e925ed402ecccb09b9e8d995d4bca2d003"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"7fc134f09db98592749f9c6a54d371fa371c178b","unresolved":false,"context_lines":[{"line_number":459,"context_line":"        # with multi-bytes"},{"line_number":460,"context_line":"        do_test("},{"line_number":461,"context_line":"            {\u0027X-Symlink-Target\u0027:"},{"line_number":462,"context_line":"             u\u0027/\\u30b0\\u30e9\\u30d6\\u30eb/\\u30a2\\u30ba\\u30ec\\u30f3\u0027},"},{"line_number":463,"context_line":"            \u0027412 Precondition Failed\u0027,"},{"line_number":464,"context_line":"            b\u0027X-Symlink-Target header must be of the \u0027"},{"line_number":465,"context_line":"            b\u0027form \u003ccontainer name\u003e/\u003cobject name\u003e\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"bfb3d3c7_2ff67b91","line":462,"updated":"2019-05-18 01:33:09.000000000","message":"We didn\u0027t need to str_to_wsgi() these?","commit_id":"20a080e925ed402ecccb09b9e8d995d4bca2d003"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"f19b073e6c3e5fb12b62addd378ce43863953e1c","unresolved":false,"context_lines":[{"line_number":458,"context_line":"        # with multi-bytes"},{"line_number":459,"context_line":"        do_test("},{"line_number":460,"context_line":"            {\u0027X-Symlink-Target\u0027:"},{"line_number":461,"context_line":"             u\u0027/\\u30b0\\u30e9\\u30d6\\u30eb/\\u30a2\\u30ba\\u30ec\\u30f3\u0027},"},{"line_number":462,"context_line":"            \u0027412 Precondition Failed\u0027,"},{"line_number":463,"context_line":"            b\u0027X-Symlink-Target header must be of the \u0027"},{"line_number":464,"context_line":"            b\u0027form \u003ccontainer name\u003e/\u003cobject name\u003e\u0027)"}],"source_content_type":"text/x-python","patch_set":3,"id":"bfb3d3c7_7c35f3d9","line":461,"updated":"2019-05-20 20:26:38.000000000","message":"This still feels suspicious :-/\n\nI don\u0027t think we\u0027re testing the same thing; py2 will get these to wsgi strings, but py3 won\u0027t:\n\n $ python2 -c \u0027from swift.common.swob import Request; print(dict(Request.blank(\"/\", headers\u003d{\"x-header\": u\"\\u30b0\"}).headers))\u0027\n {\u0027X-Header\u0027: \u0027\\xe3\\x82\\xb0\u0027, \u0027Host\u0027: \u0027localhost:80\u0027}\n\n $ python3 -c \u0027from swift.common.swob import Request; print(dict(Request.blank(\"/\", headers\u003d{\"x-header\": u\"\\u30b0\"}).headers))\u0027\n {\u0027Host\u0027: \u0027localhost:80\u0027, \u0027X-Header\u0027: \u0027グ\u0027}","commit_id":"af38a489a2b9a514876c5ba1bfbc21f915ddeeb9"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"6ac7f7f11f925859dfba5712248584918291bac7","unresolved":false,"context_lines":[{"line_number":458,"context_line":"        # with multi-bytes"},{"line_number":459,"context_line":"        do_test("},{"line_number":460,"context_line":"            {\u0027X-Symlink-Target\u0027:"},{"line_number":461,"context_line":"             u\u0027/\\u30b0\\u30e9\\u30d6\\u30eb/\\u30a2\\u30ba\\u30ec\\u30f3\u0027},"},{"line_number":462,"context_line":"            \u0027412 Precondition Failed\u0027,"},{"line_number":463,"context_line":"            b\u0027X-Symlink-Target header must be of the \u0027"},{"line_number":464,"context_line":"            b\u0027form \u003ccontainer name\u003e/\u003cobject name\u003e\u0027)"}],"source_content_type":"text/x-python","patch_set":3,"id":"bfb3d3c7_2cc80972","line":461,"in_reply_to":"bfb3d3c7_7c35f3d9","updated":"2019-05-30 08:08:31.000000000","message":"True. I confirmed the header was utf-8 decoded string in py3 but not yet find the place we resolves the header value encoding...\n\nBasically, this test scenario is for check leading slash + multi-bytes so it might be ok if _check_symlink_header is available for both str and bytes.\n\nLooking at the docs of unquote, the encoding option is used just only for decoding the escape % sequence [1] so it means escape characters will be decoded by latin-1 and concat with utf-8 decoded unicode, so if i understand correctly, the test would be ok.\n\nThough we should figure out the difference with py2 and py3 and should fix later.\n\n1: https://docs.python.org/3/library/urllib.parse.html#urllib.parse.unquote","commit_id":"af38a489a2b9a514876c5ba1bfbc21f915ddeeb9"}]}
