)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"4fd7143a88eaab320b1fd0c71a29bfe75e1cfe65","unresolved":false,"context_lines":[{"line_number":7,"context_line":"py3: Adapt direct_client and internal_client"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Not all of this may be entirely obvious. The biggest change is"},{"line_number":10,"context_line":"in the way swob represents the Request.environ. Before, the"},{"line_number":11,"context_line":"terrible latin-1 representation was preserved where WSGI"},{"line_number":12,"context_line":"provided it to us. Now, we discard it as soon as possible"},{"line_number":13,"context_line":"and convert everything into a common type. This way, the"},{"line_number":14,"context_line":"bulk of the code does not need to sprinkle tests for six.PY3"},{"line_number":15,"context_line":"everywhere."},{"line_number":16,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"3f79a3b5_d5f12803","line":13,"range":{"start_line":10,"start_character":48,"end_line":13,"end_character":42},"updated":"2018-09-04 18:05:05.000000000","message":"So... are we breaking from WSGI then? What will this mean for third-party middlewares?\n\nI know we aren\u0027t *great* about preserving compatibility with such internal APIs, but breaking from WSGI seems pretty major...","commit_id":"efc003e0686f9333c90e9865e7d67db983459a5f"},{"author":{"_account_id":597,"name":"Pete Zaitcev","email":"zaitcev@kotori.zaitcev.us","username":"zaitcev"},"change_message_id":"065222e040d5b5ea1b48ea0e2bd3a4b22a4371ba","unresolved":false,"context_lines":[{"line_number":7,"context_line":"py3: Adapt direct_client and internal_client"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Not all of this may be entirely obvious. The biggest change is"},{"line_number":10,"context_line":"in the way swob represents the Request.environ. Before, the"},{"line_number":11,"context_line":"terrible latin-1 representation was preserved where WSGI"},{"line_number":12,"context_line":"provided it to us. Now, we discard it as soon as possible"},{"line_number":13,"context_line":"and convert everything into a common type. This way, the"},{"line_number":14,"context_line":"bulk of the code does not need to sprinkle tests for six.PY3"},{"line_number":15,"context_line":"everywhere."},{"line_number":16,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"3f79a3b5_eb5a23f0","line":13,"range":{"start_line":10,"start_character":48,"end_line":13,"end_character":42},"in_reply_to":"3f79a3b5_d5f12803","updated":"2018-09-04 20:01:12.000000000","message":"Yes, absolutely! It\u0027s super beneficial for the 3rd party middleware, because they don\u0027t have to do the latin-1 dance themselves. Just think about it: we (Swift) sit between them and WSGI, and we have knowledge that the WSGI lacks, that is the a-priori knowledge that our keys are in UTF-8. It is our duty to provide a comfortable environment for our middleware. BTW, just look at our in-tree middleware. It\u0027s not a small body of code.","commit_id":"efc003e0686f9333c90e9865e7d67db983459a5f"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"4fd7143a88eaab320b1fd0c71a29bfe75e1cfe65","unresolved":false,"context_lines":[{"line_number":16,"context_line":""},{"line_number":17,"context_line":"The new code is much better this way, but actually we only"},{"line_number":18,"context_line":"did it because it was absolutely impossible to make Request.blank()"},{"line_number":19,"context_line":"work when direct_client used it."},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"There was a lot of ripple form that, as we needed to firewall"},{"line_number":22,"context_line":"all uses of the Request.path_info, as well as env[\u0027PATH_INFO\u0027]"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"3f79a3b5_95dbb07b","line":19,"updated":"2018-09-04 18:05:05.000000000","message":"Hmm... interesting...\n\nI might want more info about what was going on here.","commit_id":"efc003e0686f9333c90e9865e7d67db983459a5f"},{"author":{"_account_id":597,"name":"Pete Zaitcev","email":"zaitcev@kotori.zaitcev.us","username":"zaitcev"},"change_message_id":"065222e040d5b5ea1b48ea0e2bd3a4b22a4371ba","unresolved":false,"context_lines":[{"line_number":16,"context_line":""},{"line_number":17,"context_line":"The new code is much better this way, but actually we only"},{"line_number":18,"context_line":"did it because it was absolutely impossible to make Request.blank()"},{"line_number":19,"context_line":"work when direct_client used it."},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"There was a lot of ripple form that, as we needed to firewall"},{"line_number":22,"context_line":"all uses of the Request.path_info, as well as env[\u0027PATH_INFO\u0027]"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"3f79a3b5_0bbc3fda","line":19,"in_reply_to":"3f79a3b5_95dbb07b","updated":"2018-09-04 20:01:12.000000000","message":"The problem with the test framework there is, it wants to re-construct the way path_info is constructed from account and container. It can\u0027t do it portably. I tried and it was a huge mess - a bunch of permutations, if PY3 all over.","commit_id":"efc003e0686f9333c90e9865e7d67db983459a5f"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"4fd7143a88eaab320b1fd0c71a29bfe75e1cfe65","unresolved":false,"context_lines":[{"line_number":24,"context_line":"in terms of what has what type."},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"The internal_client didn\u0027t need much, just a bunch of fix-ups."},{"line_number":27,"context_line":"The problem with \u0027%s\u0027 is that it makes paths like \"/b\u00270\u0027/b\u0027abc\u0027\"."},{"line_number":28,"context_line":"It\u0027s the same reason why we prohibit str(): no exception is raised,"},{"line_number":29,"context_line":"just bogus corrupted data leaking all over."},{"line_number":30,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"3f79a3b5_b5d6ec52","line":27,"range":{"start_line":27,"start_character":0,"end_line":27,"end_character":65},"updated":"2018-09-04 18:05:05.000000000","message":"Yup... :-(","commit_id":"efc003e0686f9333c90e9865e7d67db983459a5f"}],"swift/common/direct_client.py":[{"author":{"_account_id":6968,"name":"Christian Schwede","email":"cschwede@nvidia.com","username":"cschwede"},"change_message_id":"0314d91693621b17ccd80ab69654e6ec5e9cf02d","unresolved":false,"context_lines":[{"line_number":54,"context_line":"            http_reason\u003dresp.reason, http_headers\u003dheaders)"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"def _make_path(*components):"},{"line_number":58,"context_line":"    return b\u0027/\u0027 + b\u0027/\u0027.join("},{"line_number":59,"context_line":"        [x if isinstance(x, six.binary_type) else x.encode(\u0027utf-8\u0027)"},{"line_number":60,"context_line":"         for x in components])"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_f05c271a","line":57,"updated":"2018-08-24 11:42:47.000000000","message":"Can you add an optional argument to specify the delimiter here? Sth like (*components, delimiter\u003db\u0027/\u0027)?","commit_id":"7bca947f317f64fb912411252c03e39337c60197"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"4fd7143a88eaab320b1fd0c71a29bfe75e1cfe65","unresolved":false,"context_lines":[{"line_number":54,"context_line":"            http_reason\u003dresp.reason, http_headers\u003dheaders)"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"def _make_path(*components):"},{"line_number":58,"context_line":"    return b\u0027/\u0027 + b\u0027/\u0027.join("},{"line_number":59,"context_line":"        [x if isinstance(x, six.binary_type) else x.encode(\u0027utf-8\u0027)"},{"line_number":60,"context_line":"         for x in components])"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_1c4c8b9c","line":57,"in_reply_to":"3f79a3b5_f05c271a","updated":"2018-09-04 18:05:05.000000000","message":"That\u0027d be reasonably cool for py3, but I\u0027m pretty sure it\u0027s a SyntaxError on py2.\n\nDo we ever actually expect to need a different delimiter? I\u0027m inclined to say YAGNI...","commit_id":"7bca947f317f64fb912411252c03e39337c60197"},{"author":{"_account_id":6968,"name":"Christian Schwede","email":"cschwede@nvidia.com","username":"cschwede"},"change_message_id":"0314d91693621b17ccd80ab69654e6ec5e9cf02d","unresolved":false,"context_lines":[{"line_number":553,"context_line":""},{"line_number":554,"context_line":"    path \u003d b\u0027/\u0027 + b\u0027-\u0027.join("},{"line_number":555,"context_line":"        [x if isinstance(x, six.binary_type) else x.encode(\u0027utf-8\u0027)"},{"line_number":556,"context_line":"         for x in suffixes])"},{"line_number":557,"context_line":"    with Timeout(conn_timeout):"},{"line_number":558,"context_line":"        conn \u003d http_connect(node[\u0027replication_ip\u0027], node[\u0027replication_port\u0027],"},{"line_number":559,"context_line":"                            node[\u0027device\u0027], part, \u0027REPLICATE\u0027, path,"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_30acdfeb","line":556,"updated":"2018-08-24 11:42:47.000000000","message":"You could re-use make_path if the delimiter is optional, ie using sth like _make_path(suffixes, b\u0027-\u0027) or so?","commit_id":"7bca947f317f64fb912411252c03e39337c60197"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"d90848d982dbbd341e05108d8b2e7757932d7613","unresolved":false,"context_lines":[{"line_number":56,"context_line":""},{"line_number":57,"context_line":"def _make_path(*components):"},{"line_number":58,"context_line":"    return b\u0027/\u0027 + b\u0027/\u0027.join("},{"line_number":59,"context_line":"        [x if isinstance(x, six.binary_type) else x.encode(\u0027utf-8\u0027)"},{"line_number":60,"context_line":"         for x in components])"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_29e16e9c","line":59,"range":{"start_line":59,"start_character":8,"end_line":59,"end_character":9},"updated":"2018-09-12 03:54:41.000000000","message":"nit: Don\u0027t need the comprehension.","commit_id":"0ad487331029ef278257e267a5ed9f07d738a6eb"},{"author":{"_account_id":597,"name":"Pete Zaitcev","email":"zaitcev@kotori.zaitcev.us","username":"zaitcev"},"change_message_id":"6ddf1516e429a23cc5752642d3698d4ac29a9270","unresolved":false,"context_lines":[{"line_number":56,"context_line":""},{"line_number":57,"context_line":"def _make_path(*components):"},{"line_number":58,"context_line":"    return b\u0027/\u0027 + b\u0027/\u0027.join("},{"line_number":59,"context_line":"        [x if isinstance(x, six.binary_type) else x.encode(\u0027utf-8\u0027)"},{"line_number":60,"context_line":"         for x in components])"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_3460d70d","line":59,"range":{"start_line":59,"start_character":8,"end_line":59,"end_character":9},"in_reply_to":"3f79a3b5_29e16e9c","updated":"2018-09-12 17:00:35.000000000","message":"Done","commit_id":"0ad487331029ef278257e267a5ed9f07d738a6eb"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"d90848d982dbbd341e05108d8b2e7757932d7613","unresolved":false,"context_lines":[{"line_number":206,"context_line":"    :returns: a tuple of (response headers, a list of containers) The response"},{"line_number":207,"context_line":"              headers will HeaderKeyDict."},{"line_number":208,"context_line":"    \"\"\""},{"line_number":209,"context_line":"    path \u003d _make_path(account)"},{"line_number":210,"context_line":"    return _get_direct_account_container(path, \"Account\", node, part,"},{"line_number":211,"context_line":"                                         marker\u003dmarker,"},{"line_number":212,"context_line":"                                         limit\u003dlimit, prefix\u003dprefix,"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_84666755","line":209,"updated":"2018-09-12 03:54:41.000000000","message":"So... who passes it as bytes, and who passes it as unicode?\n\nAre we *certain* that no body passes it as a wsgi string? Looks like we\u0027ve got\n\n- swift/cli/dispersion_report.py\n- swift/container/reconciler.py\n- swift/container/sharder.py\n- swift/account/reaper.py\n\n... I guess none of them ought to be thinking in terms of WSGI...","commit_id":"0ad487331029ef278257e267a5ed9f07d738a6eb"},{"author":{"_account_id":597,"name":"Pete Zaitcev","email":"zaitcev@kotori.zaitcev.us","username":"zaitcev"},"change_message_id":"6ddf1516e429a23cc5752642d3698d4ac29a9270","unresolved":false,"context_lines":[{"line_number":206,"context_line":"    :returns: a tuple of (response headers, a list of containers) The response"},{"line_number":207,"context_line":"              headers will HeaderKeyDict."},{"line_number":208,"context_line":"    \"\"\""},{"line_number":209,"context_line":"    path \u003d _make_path(account)"},{"line_number":210,"context_line":"    return _get_direct_account_container(path, \"Account\", node, part,"},{"line_number":211,"context_line":"                                         marker\u003dmarker,"},{"line_number":212,"context_line":"                                         limit\u003dlimit, prefix\u003dprefix,"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_342e97ab","line":209,"in_reply_to":"3f79a3b5_84666755","updated":"2018-09-12 17:00:35.000000000","message":"None of them is controlled through REST, aren\u0027t they?","commit_id":"0ad487331029ef278257e267a5ed9f07d738a6eb"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"d90848d982dbbd341e05108d8b2e7757932d7613","unresolved":false,"context_lines":[{"line_number":553,"context_line":""},{"line_number":554,"context_line":"    path \u003d b\u0027/\u0027 + b\u0027-\u0027.join("},{"line_number":555,"context_line":"        [x if isinstance(x, six.binary_type) else x.encode(\u0027utf-8\u0027)"},{"line_number":556,"context_line":"         for x in suffixes])"},{"line_number":557,"context_line":"    with Timeout(conn_timeout):"},{"line_number":558,"context_line":"        conn \u003d http_connect(node[\u0027replication_ip\u0027], node[\u0027replication_port\u0027],"},{"line_number":559,"context_line":"                            node[\u0027device\u0027], part, \u0027REPLICATE\u0027, path,"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_0497b7ed","line":556,"updated":"2018-09-12 03:54:41.000000000","message":"Oh, I guess I see why Christian mentioned the idea of having a delimiter arg...\n\nsuffixes should only ever be hex strings, yeah? Should we use ASCII to weakly validate that assumption?","commit_id":"0ad487331029ef278257e267a5ed9f07d738a6eb"},{"author":{"_account_id":597,"name":"Pete Zaitcev","email":"zaitcev@kotori.zaitcev.us","username":"zaitcev"},"change_message_id":"6ddf1516e429a23cc5752642d3698d4ac29a9270","unresolved":false,"context_lines":[{"line_number":553,"context_line":""},{"line_number":554,"context_line":"    path \u003d b\u0027/\u0027 + b\u0027-\u0027.join("},{"line_number":555,"context_line":"        [x if isinstance(x, six.binary_type) else x.encode(\u0027utf-8\u0027)"},{"line_number":556,"context_line":"         for x in suffixes])"},{"line_number":557,"context_line":"    with Timeout(conn_timeout):"},{"line_number":558,"context_line":"        conn \u003d http_connect(node[\u0027replication_ip\u0027], node[\u0027replication_port\u0027],"},{"line_number":559,"context_line":"                            node[\u0027device\u0027], part, \u0027REPLICATE\u0027, path,"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_a766fbed","line":556,"in_reply_to":"3f79a3b5_0497b7ed","updated":"2018-09-12 17:00:35.000000000","message":"I didn\u0027t act upon Cristian\u0027s comment because in my mind the commonality was purely coincidental. It\u0027s not \"path components\", but \"some things that are separated by dashes\". Worse, there\u0027s still a slash in front, not a dash. I think farming it into _make_path would not reflect the nature of the object we\u0027re manipulating. But I\u0027m not super digging my heels about this.\n\nI did remove the comprehension though. Changed to ascii, too.\n\nNote that this affects py2 path. Thankfully, it\u0027s valid to encode an str on py2, and a result is an unchanged str. Typically I\u0027m trying to avoid damaging py2 at all, but it conflicts with my desire to avoid six.PY3 checks.","commit_id":"0ad487331029ef278257e267a5ed9f07d738a6eb"}],"swift/common/internal_client.py":[{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"d90848d982dbbd341e05108d8b2e7757932d7613","unresolved":false,"context_lines":[{"line_number":114,"context_line":"            self.first \u003d False"},{"line_number":115,"context_line":"            header \u003d b\u0027\\037\\213\\010\\000\\000\\000\\000\\000\\002\\377\u0027"},{"line_number":116,"context_line":"            compressed \u003d header + compressed"},{"line_number":117,"context_line":"        return compressed"},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"    def __iter__(self):"},{"line_number":120,"context_line":"        return self"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_447a8fba","line":117,"updated":"2018-09-12 03:54:41.000000000","message":"Off-topic: I, uh... huh. So we\u0027re re-implementing RFC 1952? I kinda woulda preferred something like https://gist.github.com/tipabu/7c8ed7a713a7f51f20c2#file-compression-py-L78-L97 but I guess that\u0027s me.\n\nAt least we didn\u0027t re-implement RFC 1951, too...","commit_id":"0ad487331029ef278257e267a5ed9f07d738a6eb"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"d90848d982dbbd341e05108d8b2e7757932d7613","unresolved":false,"context_lines":[{"line_number":163,"context_line":"        \"\"\"Makes a request to Swift with retries."},{"line_number":164,"context_line":""},{"line_number":165,"context_line":"        :param method: HTTP method of request."},{"line_number":166,"context_line":"        :param path: Path of request (bytes)."},{"line_number":167,"context_line":"        :param headers: Headers to be sent with request."},{"line_number":168,"context_line":"        :param acceptable_statuses: List of acceptable statuses for request."},{"line_number":169,"context_line":"        :param body_file: Body file to be passed along with request,"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_8459875c","line":166,"updated":"2018-09-12 03:54:41.000000000","message":"Should we throw a ValueError otherwise?","commit_id":"0ad487331029ef278257e267a5ed9f07d738a6eb"},{"author":{"_account_id":597,"name":"Pete Zaitcev","email":"zaitcev@kotori.zaitcev.us","username":"zaitcev"},"change_message_id":"6ddf1516e429a23cc5752642d3698d4ac29a9270","unresolved":false,"context_lines":[{"line_number":163,"context_line":"        \"\"\"Makes a request to Swift with retries."},{"line_number":164,"context_line":""},{"line_number":165,"context_line":"        :param method: HTTP method of request."},{"line_number":166,"context_line":"        :param path: Path of request (bytes)."},{"line_number":167,"context_line":"        :param headers: Headers to be sent with request."},{"line_number":168,"context_line":"        :param acceptable_statuses: List of acceptable statuses for request."},{"line_number":169,"context_line":"        :param body_file: Body file to be passed along with request,"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_2a34f2ab","line":166,"in_reply_to":"3f79a3b5_8459875c","updated":"2018-09-12 17:00:35.000000000","message":"I feel yes, and I had it there, but then something made the check get removed... I can easily add it back.","commit_id":"0ad487331029ef278257e267a5ed9f07d738a6eb"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"d90848d982dbbd341e05108d8b2e7757932d7613","unresolved":false,"context_lines":[{"line_number":294,"context_line":"                if resp.status_int \u003e\u003d HTTP_MULTIPLE_CHOICES:"},{"line_number":295,"context_line":"                    b\u0027\u0027.join(resp.app_iter)"},{"line_number":296,"context_line":"                break"},{"line_number":297,"context_line":"            data \u003d json.loads(resp.body)"},{"line_number":298,"context_line":"            if not data:"},{"line_number":299,"context_line":"                break"},{"line_number":300,"context_line":"            for item in data:"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_a437e3fe","line":297,"updated":"2018-09-12 03:54:41.000000000","message":"We don\u0027t need to decode back to unicode here? Maybe that was just *some* version of py35... and not the ones we\u0027d hit in the gate...","commit_id":"0ad487331029ef278257e267a5ed9f07d738a6eb"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"db50e65b99d9e46c29e8bcba3604908d0f435104","unresolved":false,"context_lines":[{"line_number":294,"context_line":"                if resp.status_int \u003e\u003d HTTP_MULTIPLE_CHOICES:"},{"line_number":295,"context_line":"                    b\u0027\u0027.join(resp.app_iter)"},{"line_number":296,"context_line":"                break"},{"line_number":297,"context_line":"            data \u003d json.loads(resp.body)"},{"line_number":298,"context_line":"            if not data:"},{"line_number":299,"context_line":"                break"},{"line_number":300,"context_line":"            for item in data:"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_361c5776","line":297,"in_reply_to":"3f79a3b5_4a628eaf","updated":"2018-09-12 17:53:18.000000000","message":"(py35) $ python\nPython 3.5.5 (default, Apr 27 2018, 03:26:54)\n[GCC 7.3.0] on linux\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n\u003e\u003e\u003e import json\n\u003e\u003e\u003e json.loads(b\u0027{}\u0027)\nTraceback (most recent call last):\n  File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\n  File \"/usr/lib/python3.5/json/__init__.py\", line 312, in loads\n    s.__class__.__name__))\nTypeError: the JSON object must be str, not \u0027bytes\u0027\n\nBut the gate seems fine? *shrug*","commit_id":"0ad487331029ef278257e267a5ed9f07d738a6eb"},{"author":{"_account_id":597,"name":"Pete Zaitcev","email":"zaitcev@kotori.zaitcev.us","username":"zaitcev"},"change_message_id":"6ddf1516e429a23cc5752642d3698d4ac29a9270","unresolved":false,"context_lines":[{"line_number":294,"context_line":"                if resp.status_int \u003e\u003d HTTP_MULTIPLE_CHOICES:"},{"line_number":295,"context_line":"                    b\u0027\u0027.join(resp.app_iter)"},{"line_number":296,"context_line":"                break"},{"line_number":297,"context_line":"            data \u003d json.loads(resp.body)"},{"line_number":298,"context_line":"            if not data:"},{"line_number":299,"context_line":"                break"},{"line_number":300,"context_line":"            for item in data:"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_4a628eaf","line":297,"in_reply_to":"3f79a3b5_a437e3fe","updated":"2018-09-12 17:00:35.000000000","message":"I dunno, json seems to eat the bytes.","commit_id":"0ad487331029ef278257e267a5ed9f07d738a6eb"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"d90848d982dbbd341e05108d8b2e7757932d7613","unresolved":false,"context_lines":[{"line_number":303,"context_line":""},{"line_number":304,"context_line":"    def make_path(self, account, container\u003dNone, obj\u003dNone):"},{"line_number":305,"context_line":"        \"\"\""},{"line_number":306,"context_line":"        Returns a swift path for a request quoting and utf-8 encoding the path"},{"line_number":307,"context_line":"        parts as need be."},{"line_number":308,"context_line":""},{"line_number":309,"context_line":"        :param account: swift account"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_8407471e","line":306,"range":{"start_line":306,"start_character":51,"end_line":306,"end_character":69},"updated":"2018-09-12 03:54:41.000000000","message":"Do we actually do this? I don\u0027t see where... I guess maybe it\u0027s handled by swift.common.utils.quote? Should we just be doing that for direct_client?","commit_id":"0ad487331029ef278257e267a5ed9f07d738a6eb"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"db50e65b99d9e46c29e8bcba3604908d0f435104","unresolved":false,"context_lines":[{"line_number":303,"context_line":""},{"line_number":304,"context_line":"    def make_path(self, account, container\u003dNone, obj\u003dNone):"},{"line_number":305,"context_line":"        \"\"\""},{"line_number":306,"context_line":"        Returns a swift path for a request quoting and utf-8 encoding the path"},{"line_number":307,"context_line":"        parts as need be."},{"line_number":308,"context_line":""},{"line_number":309,"context_line":"        :param account: swift account"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_5c06d51e","line":306,"range":{"start_line":306,"start_character":51,"end_line":306,"end_character":69},"in_reply_to":"3f79a3b5_2a2b9233","updated":"2018-09-12 17:53:18.000000000","message":"Over in direct_client, we grew a new _make_path helper that *does* do UTF-8 encoding... I\u0027m just wondering if we ought to be quoting over there instead of the helper.","commit_id":"0ad487331029ef278257e267a5ed9f07d738a6eb"},{"author":{"_account_id":597,"name":"Pete Zaitcev","email":"zaitcev@kotori.zaitcev.us","username":"zaitcev"},"change_message_id":"6ddf1516e429a23cc5752642d3698d4ac29a9270","unresolved":false,"context_lines":[{"line_number":303,"context_line":""},{"line_number":304,"context_line":"    def make_path(self, account, container\u003dNone, obj\u003dNone):"},{"line_number":305,"context_line":"        \"\"\""},{"line_number":306,"context_line":"        Returns a swift path for a request quoting and utf-8 encoding the path"},{"line_number":307,"context_line":"        parts as need be."},{"line_number":308,"context_line":""},{"line_number":309,"context_line":"        :param account: swift account"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_2a2b9233","line":306,"range":{"start_line":306,"start_character":51,"end_line":306,"end_character":69},"in_reply_to":"3f79a3b5_8407471e","updated":"2018-09-12 17:00:35.000000000","message":"Our quote differs from the stock one, but both end with everything quoted. I guess I don\u0027t follow. I\u0027ll ask you later.","commit_id":"0ad487331029ef278257e267a5ed9f07d738a6eb"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"d90848d982dbbd341e05108d8b2e7757932d7613","unresolved":false,"context_lines":[{"line_number":694,"context_line":"            return"},{"line_number":695,"context_line":""},{"line_number":696,"context_line":"        last_part \u003d b\u0027\u0027"},{"line_number":697,"context_line":"        compressed \u003d obj.endswith(\u0027.gz\u0027)"},{"line_number":698,"context_line":"        # magic in the following zlib.decompressobj argument is courtesy of"},{"line_number":699,"context_line":"        # Python decompressing gzip chunk-by-chunk"},{"line_number":700,"context_line":"        # http://stackoverflow.com/questions/2423866"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_c4153f4b","line":697,"updated":"2018-09-12 03:54:41.000000000","message":"So obj will be native string or unicode? Good news is, if we\u0027re wrong about that we TypeError on py3 instead of assuming uncompressed...","commit_id":"0ad487331029ef278257e267a5ed9f07d738a6eb"},{"author":{"_account_id":597,"name":"Pete Zaitcev","email":"zaitcev@kotori.zaitcev.us","username":"zaitcev"},"change_message_id":"6ddf1516e429a23cc5752642d3698d4ac29a9270","unresolved":false,"context_lines":[{"line_number":694,"context_line":"            return"},{"line_number":695,"context_line":""},{"line_number":696,"context_line":"        last_part \u003d b\u0027\u0027"},{"line_number":697,"context_line":"        compressed \u003d obj.endswith(\u0027.gz\u0027)"},{"line_number":698,"context_line":"        # magic in the following zlib.decompressobj argument is courtesy of"},{"line_number":699,"context_line":"        # Python decompressing gzip chunk-by-chunk"},{"line_number":700,"context_line":"        # http://stackoverflow.com/questions/2423866"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_eab27a06","line":697,"in_reply_to":"3f79a3b5_c4153f4b","updated":"2018-09-12 17:00:35.000000000","message":"I presume unicode for everything that is not a path. So, as soon as someone does split(\u0027/\u0027), decode() follows. If you see a missing place, I\u0027ll fix it up.","commit_id":"0ad487331029ef278257e267a5ed9f07d738a6eb"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"d90848d982dbbd341e05108d8b2e7757932d7613","unresolved":false,"context_lines":[{"line_number":704,"context_line":"                chunk \u003d d.decompress(chunk)"},{"line_number":705,"context_line":"            parts \u003d chunk.split(b\u0027\\n\u0027)"},{"line_number":706,"context_line":"            if len(parts) \u003d\u003d 1:"},{"line_number":707,"context_line":"                last_part \u003d last_part + parts[0]"},{"line_number":708,"context_line":"            else:"},{"line_number":709,"context_line":"                parts[0] \u003d last_part + parts[0]"},{"line_number":710,"context_line":"                for part in parts[:-1]:"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_44284f96","line":707,"updated":"2018-09-12 03:54:41.000000000","message":"Off-topic: Ick -- this\u0027ll suck if your file doesn\u0027t actually container newlines...","commit_id":"0ad487331029ef278257e267a5ed9f07d738a6eb"},{"author":{"_account_id":597,"name":"Pete Zaitcev","email":"zaitcev@kotori.zaitcev.us","username":"zaitcev"},"change_message_id":"6ddf1516e429a23cc5752642d3698d4ac29a9270","unresolved":false,"context_lines":[{"line_number":704,"context_line":"                chunk \u003d d.decompress(chunk)"},{"line_number":705,"context_line":"            parts \u003d chunk.split(b\u0027\\n\u0027)"},{"line_number":706,"context_line":"            if len(parts) \u003d\u003d 1:"},{"line_number":707,"context_line":"                last_part \u003d last_part + parts[0]"},{"line_number":708,"context_line":"            else:"},{"line_number":709,"context_line":"                parts[0] \u003d last_part + parts[0]"},{"line_number":710,"context_line":"                for part in parts[:-1]:"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_6ac66a6b","line":707,"in_reply_to":"3f79a3b5_44284f96","updated":"2018-09-12 17:00:35.000000000","message":"I dunno, app_iter should return some reasonable chunks.","commit_id":"0ad487331029ef278257e267a5ed9f07d738a6eb"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"db50e65b99d9e46c29e8bcba3604908d0f435104","unresolved":false,"context_lines":[{"line_number":704,"context_line":"                chunk \u003d d.decompress(chunk)"},{"line_number":705,"context_line":"            parts \u003d chunk.split(b\u0027\\n\u0027)"},{"line_number":706,"context_line":"            if len(parts) \u003d\u003d 1:"},{"line_number":707,"context_line":"                last_part \u003d last_part + parts[0]"},{"line_number":708,"context_line":"            else:"},{"line_number":709,"context_line":"                parts[0] \u003d last_part + parts[0]"},{"line_number":710,"context_line":"                for part in parts[:-1]:"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_bc9b69c6","line":707,"in_reply_to":"3f79a3b5_6ac66a6b","updated":"2018-09-12 17:53:18.000000000","message":"Just the O(N**2) nature of it -- but yeah, I suppose the chunks ought to be like 64k or 1M or something, so it\u0027s probably not a problem.","commit_id":"0ad487331029ef278257e267a5ed9f07d738a6eb"}],"swift/common/middleware/__init__.py":[{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"d90848d982dbbd341e05108d8b2e7757932d7613","unresolved":false,"context_lines":[{"line_number":36,"context_line":"        for i, (header, value) in enumerate(self._response_headers):"},{"line_number":37,"context_line":"            if header.lower() in (\u0027location\u0027, \u0027content-location\u0027):"},{"line_number":38,"context_line":"                self._response_headers[i] \u003d (header, self.rewritten_re.sub("},{"line_number":39,"context_line":"                    r\u0027\\1%s\\2\u0027 % self.requested, value))"},{"line_number":40,"context_line":"        start_response(self._response_status, self._response_headers,"},{"line_number":41,"context_line":"                       self._response_exc_info)"},{"line_number":42,"context_line":"        return resp_iter"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_aa2fad86","line":39,"updated":"2018-09-12 03:54:41.000000000","message":"So on py2 -- is the header still bytes, or is it now unicode?","commit_id":"0ad487331029ef278257e267a5ed9f07d738a6eb"},{"author":{"_account_id":597,"name":"Pete Zaitcev","email":"zaitcev@kotori.zaitcev.us","username":"zaitcev"},"change_message_id":"6ddf1516e429a23cc5752642d3698d4ac29a9270","unresolved":false,"context_lines":[{"line_number":36,"context_line":"        for i, (header, value) in enumerate(self._response_headers):"},{"line_number":37,"context_line":"            if header.lower() in (\u0027location\u0027, \u0027content-location\u0027):"},{"line_number":38,"context_line":"                self._response_headers[i] \u003d (header, self.rewritten_re.sub("},{"line_number":39,"context_line":"                    r\u0027\\1%s\\2\u0027 % self.requested, value))"},{"line_number":40,"context_line":"        start_response(self._response_status, self._response_headers,"},{"line_number":41,"context_line":"                       self._response_exc_info)"},{"line_number":42,"context_line":"        return resp_iter"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_ca777e3b","line":39,"in_reply_to":"3f79a3b5_aa2fad86","updated":"2018-09-12 17:00:35.000000000","message":"I don\u0027t think it\u0027s possible for headers to be bytes. That\u0027s why all the dance around Location, for example.","commit_id":"0ad487331029ef278257e267a5ed9f07d738a6eb"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"db50e65b99d9e46c29e8bcba3604908d0f435104","unresolved":false,"context_lines":[{"line_number":36,"context_line":"        for i, (header, value) in enumerate(self._response_headers):"},{"line_number":37,"context_line":"            if header.lower() in (\u0027location\u0027, \u0027content-location\u0027):"},{"line_number":38,"context_line":"                self._response_headers[i] \u003d (header, self.rewritten_re.sub("},{"line_number":39,"context_line":"                    r\u0027\\1%s\\2\u0027 % self.requested, value))"},{"line_number":40,"context_line":"        start_response(self._response_status, self._response_headers,"},{"line_number":41,"context_line":"                       self._response_exc_info)"},{"line_number":42,"context_line":"        return resp_iter"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_3c90b996","line":39,"in_reply_to":"3f79a3b5_ca777e3b","updated":"2018-09-12 17:53:18.000000000","message":"WSGI says\n\n\u003e \"Native\" strings (which are always implemented using the type named str) that are used for request/response headers and metadata\n\nso we probably ought to give eventlet bytes on py2. (Though maybe they do something smart if we slip up an offer unicode? IDK what encoding they\u0027d use, though...)","commit_id":"0ad487331029ef278257e267a5ed9f07d738a6eb"}],"swift/common/middleware/domain_remap.py":[{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"d90848d982dbbd341e05108d8b2e7757932d7613","unresolved":false,"context_lines":[{"line_number":131,"context_line":"                                if s.startswith(\u0027.\u0027)]"},{"line_number":132,"context_line":"        self.path_root \u003d conf.get(\u0027path_root\u0027, \u0027v1\u0027).strip(\u0027/\u0027) + \u0027/\u0027"},{"line_number":133,"context_line":"        if six.PY3:"},{"line_number":134,"context_line":"            self.path_root \u003d self.path_root.encode(\u0027ascii\u0027)"},{"line_number":135,"context_line":"        prefixes \u003d conf.get(\u0027reseller_prefixes\u0027, \u0027AUTH\u0027)"},{"line_number":136,"context_line":"        self.reseller_prefixes \u003d list_from_csv(prefixes)"},{"line_number":137,"context_line":"        self.reseller_prefixes_lower \u003d [x.lower()"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_0a6d81cb","line":134,"range":{"start_line":134,"start_character":52,"end_line":134,"end_character":57},"updated":"2018-09-12 03:54:41.000000000","message":"+1, woe to the deployer that would set this to anything non-ASCII","commit_id":"0ad487331029ef278257e267a5ed9f07d738a6eb"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"d90848d982dbbd341e05108d8b2e7757932d7613","unresolved":false,"context_lines":[{"line_number":187,"context_line":"            requested_path \u003d env[\u0027PATH_INFO\u0027]"},{"line_number":188,"context_line":"            path \u003d requested_path[1:]"},{"line_number":189,"context_line":"            new_path_parts \u003d [b\u0027\u0027, self.path_root[:-1],"},{"line_number":190,"context_line":"                              account.encode(\u0027utf-8\u0027)]"},{"line_number":191,"context_line":"            if container:"},{"line_number":192,"context_line":"                new_path_parts.append(container.encode(\u0027utf-8\u0027))"},{"line_number":193,"context_line":"            if self.mangle_client_paths and (path + b\u0027/\u0027).startswith("}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_6a9d15ba","line":190,"range":{"start_line":190,"start_character":30,"end_line":190,"end_character":53},"updated":"2018-09-12 03:54:41.000000000","message":"Are we sure account is unicode here? This feels like it might be a good spot to use wsgi_to_bytes...\n\nOh, but it\u0027s coming from the Host header/SERVER_NAME var -- and I can\u0027t imagine that we actually support RFC 5891 or anything here... so it\u0027s probably fine? Still, being willing to get it from a client-accessible header make me a little nervous...","commit_id":"0ad487331029ef278257e267a5ed9f07d738a6eb"},{"author":{"_account_id":597,"name":"Pete Zaitcev","email":"zaitcev@kotori.zaitcev.us","username":"zaitcev"},"change_message_id":"6ddf1516e429a23cc5752642d3698d4ac29a9270","unresolved":false,"context_lines":[{"line_number":187,"context_line":"            requested_path \u003d env[\u0027PATH_INFO\u0027]"},{"line_number":188,"context_line":"            path \u003d requested_path[1:]"},{"line_number":189,"context_line":"            new_path_parts \u003d [b\u0027\u0027, self.path_root[:-1],"},{"line_number":190,"context_line":"                              account.encode(\u0027utf-8\u0027)]"},{"line_number":191,"context_line":"            if container:"},{"line_number":192,"context_line":"                new_path_parts.append(container.encode(\u0027utf-8\u0027))"},{"line_number":193,"context_line":"            if self.mangle_client_paths and (path + b\u0027/\u0027).startswith("}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_cac53e3f","line":190,"range":{"start_line":190,"start_character":30,"end_line":190,"end_character":53},"in_reply_to":"3f79a3b5_6a9d15ba","updated":"2018-09-12 17:00:35.000000000","message":"There\u0027s a test for unicode accounts.","commit_id":"0ad487331029ef278257e267a5ed9f07d738a6eb"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"d90848d982dbbd341e05108d8b2e7757932d7613","unresolved":false,"context_lines":[{"line_number":197,"context_line":"            new_path \u003d b\u0027/\u0027.join(new_path_parts)"},{"line_number":198,"context_line":"            env[\u0027PATH_INFO\u0027] \u003d new_path"},{"line_number":199,"context_line":""},{"line_number":200,"context_line":"            context \u003d _DomainRemapContext(self.app, requested_path, new_path)"},{"line_number":201,"context_line":"            return context.handle_request(env, start_response)"},{"line_number":202,"context_line":""},{"line_number":203,"context_line":"        return self.app(env, start_response)"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_aab24d48","line":200,"range":{"start_line":200,"start_character":68,"end_line":200,"end_character":76},"updated":"2018-09-12 03:54:41.000000000","message":"Interesting... so we forced it to bytes in this module so we could force it to unicode in the Context...","commit_id":"0ad487331029ef278257e267a5ed9f07d738a6eb"}],"swift/common/request_helpers.py":[{"author":{"_account_id":6968,"name":"Christian Schwede","email":"cschwede@nvidia.com","username":"cschwede"},"change_message_id":"edf4ce6bf6d591b5a2a412ff899b7ad3b392c8bb","unresolved":false,"context_lines":[{"line_number":26,"context_line":"import time"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"import six"},{"line_number":29,"context_line":"from six.moves.urllib.parse import unquote, unquote_to_bytes"},{"line_number":30,"context_line":"from swift.common.header_key_dict import HeaderKeyDict"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"from swift import gettext_ as _"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_eceb3d75","line":29,"updated":"2018-09-03 09:58:07.000000000","message":"unquote_to_bytes was added in six 1.11.0: https://github.com/benjaminp/six/blob/master/CHANGES#L24\n\nSo we need to bump the six version in requirements.txt.","commit_id":"efc003e0686f9333c90e9865e7d67db983459a5f"},{"author":{"_account_id":597,"name":"Pete Zaitcev","email":"zaitcev@kotori.zaitcev.us","username":"zaitcev"},"change_message_id":"065222e040d5b5ea1b48ea0e2bd3a4b22a4371ba","unresolved":false,"context_lines":[{"line_number":26,"context_line":"import time"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"import six"},{"line_number":29,"context_line":"from six.moves.urllib.parse import unquote, unquote_to_bytes"},{"line_number":30,"context_line":"from swift.common.header_key_dict import HeaderKeyDict"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"from swift import gettext_ as _"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_abcc2b89","line":29,"in_reply_to":"3f79a3b5_eceb3d75","updated":"2018-09-04 20:01:12.000000000","message":"Done","commit_id":"efc003e0686f9333c90e9865e7d67db983459a5f"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"4fd7143a88eaab320b1fd0c71a29bfe75e1cfe65","unresolved":false,"context_lines":[{"line_number":97,"context_line":"    return results"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"def split_and_validate_path(request, minsegs\u003d1, maxsegs\u003dNone,"},{"line_number":101,"context_line":"                            rest_with_last\u003dFalse):"},{"line_number":102,"context_line":"    \"\"\""},{"line_number":103,"context_line":"    Utility function to split and validate the request path."}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_9fae4de5","line":100,"range":{"start_line":100,"start_character":37,"end_line":100,"end_character":46},"updated":"2018-09-04 18:05:05.000000000","message":"Off-topic: this is a horrible default!\n\n\u003e\u003e\u003e split_and_validate_path(Request.blank(\u0027/info\u0027))\nTraceback (most recent call last):\n  File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\n  File \".../swift/common/request_helpers.py\", line 134, in split_and_validate_path\n    validate_device_partition(segs[0], segs[1])\nIndexError: list index out of range","commit_id":"efc003e0686f9333c90e9865e7d67db983459a5f"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"4fd7143a88eaab320b1fd0c71a29bfe75e1cfe65","unresolved":false,"context_lines":[{"line_number":107,"context_line":"    :raises HTTPBadRequest: if something\u0027s not okay"},{"line_number":108,"context_line":"    \"\"\""},{"line_number":109,"context_line":"    try:"},{"line_number":110,"context_line":"        segs \u003d split_path(unquote_to_bytes(request.path),"},{"line_number":111,"context_line":"                          minsegs, maxsegs, rest_with_last)"},{"line_number":112,"context_line":"        # The validate_device_partition() needs native strings, so only"},{"line_number":113,"context_line":"        # decode where the binary type is not a string (e.g. on py3)."}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_2aa019f4","line":110,"range":{"start_line":110,"start_character":26,"end_line":110,"end_character":56},"updated":"2018-09-04 18:05:05.000000000","message":"\u003e If it is a str, unescaped non-ASCII characters in string are encoded into UTF-8 bytes.\n\n...makes me a little nervous -- are we *sure* request.path will be native strings, not WSGI strings?","commit_id":"efc003e0686f9333c90e9865e7d67db983459a5f"},{"author":{"_account_id":597,"name":"Pete Zaitcev","email":"zaitcev@kotori.zaitcev.us","username":"zaitcev"},"change_message_id":"065222e040d5b5ea1b48ea0e2bd3a4b22a4371ba","unresolved":false,"context_lines":[{"line_number":107,"context_line":"    :raises HTTPBadRequest: if something\u0027s not okay"},{"line_number":108,"context_line":"    \"\"\""},{"line_number":109,"context_line":"    try:"},{"line_number":110,"context_line":"        segs \u003d split_path(unquote_to_bytes(request.path),"},{"line_number":111,"context_line":"                          minsegs, maxsegs, rest_with_last)"},{"line_number":112,"context_line":"        # The validate_device_partition() needs native strings, so only"},{"line_number":113,"context_line":"        # decode where the binary type is not a string (e.g. on py3)."}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_8bcb6f51","line":110,"range":{"start_line":110,"start_character":26,"end_line":110,"end_character":56},"in_reply_to":"3f79a3b5_2aa019f4","updated":"2018-09-04 20:01:12.000000000","message":"I removed unquote_to_bytes(), but I do the encoding by hand, so your question is still valid. The answer is yes, we\u0027re sure. I assigned a type to every little member and env key, and path property is in unicode actually. Note that it\u0027s a virtual property, its type is regenerated every time it\u0027s constructed by the getter (from path_info et al).","commit_id":"efc003e0686f9333c90e9865e7d67db983459a5f"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"4fd7143a88eaab320b1fd0c71a29bfe75e1cfe65","unresolved":false,"context_lines":[{"line_number":112,"context_line":"        # The validate_device_partition() needs native strings, so only"},{"line_number":113,"context_line":"        # decode where the binary type is not a string (e.g. on py3)."},{"line_number":114,"context_line":"        if six.PY3:"},{"line_number":115,"context_line":"            for i in range(2):"},{"line_number":116,"context_line":"                if segs[i]:"},{"line_number":117,"context_line":"                    segs[i] \u003d segs[i].decode(\u0027utf-8\u0027)"},{"line_number":118,"context_line":"        validate_device_partition(segs[0], segs[1])"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_df0a85cf","line":115,"range":{"start_line":115,"start_character":27,"end_line":115,"end_character":28},"updated":"2018-09-04 18:05:05.000000000","message":"Why just the two? Why aren\u0027t we converting to native strings across the board?","commit_id":"efc003e0686f9333c90e9865e7d67db983459a5f"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"d90848d982dbbd341e05108d8b2e7757932d7613","unresolved":false,"context_lines":[{"line_number":112,"context_line":"        # The validate_device_partition() needs native strings, so only"},{"line_number":113,"context_line":"        # decode where the binary type is not a string (e.g. on py3)."},{"line_number":114,"context_line":"        if six.PY3:"},{"line_number":115,"context_line":"            for i in range(2):"},{"line_number":116,"context_line":"                if segs[i]:"},{"line_number":117,"context_line":"                    segs[i] \u003d segs[i].decode(\u0027utf-8\u0027)"},{"line_number":118,"context_line":"        validate_device_partition(segs[0], segs[1])"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_4a9e196a","line":115,"range":{"start_line":115,"start_character":27,"end_line":115,"end_character":28},"in_reply_to":"3f79a3b5_cb308758","updated":"2018-09-12 03:54:41.000000000","message":"I just found it wierd that we return segs on success, and depending on the value of maxsegs, you could get back\n\n [unicode, unicode, bytes, bytes]","commit_id":"efc003e0686f9333c90e9865e7d67db983459a5f"},{"author":{"_account_id":597,"name":"Pete Zaitcev","email":"zaitcev@kotori.zaitcev.us","username":"zaitcev"},"change_message_id":"065222e040d5b5ea1b48ea0e2bd3a4b22a4371ba","unresolved":false,"context_lines":[{"line_number":112,"context_line":"        # The validate_device_partition() needs native strings, so only"},{"line_number":113,"context_line":"        # decode where the binary type is not a string (e.g. on py3)."},{"line_number":114,"context_line":"        if six.PY3:"},{"line_number":115,"context_line":"            for i in range(2):"},{"line_number":116,"context_line":"                if segs[i]:"},{"line_number":117,"context_line":"                    segs[i] \u003d segs[i].decode(\u0027utf-8\u0027)"},{"line_number":118,"context_line":"        validate_device_partition(segs[0], segs[1])"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_cb308758","line":115,"range":{"start_line":115,"start_character":27,"end_line":115,"end_character":28},"in_reply_to":"3f79a3b5_df0a85cf","updated":"2018-09-04 20:01:12.000000000","message":"Sorry, I don\u0027t understand. The very next line is a fixed argument call to validate_device_partition() that consumes these, so there must be two...","commit_id":"efc003e0686f9333c90e9865e7d67db983459a5f"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"d90848d982dbbd341e05108d8b2e7757932d7613","unresolved":false,"context_lines":[{"line_number":112,"context_line":"        # with bytes only (it needs to compare with b\u0027/\u0027). The unquote()"},{"line_number":113,"context_line":"        # provides us with just the thing that validate_device_partition()"},{"line_number":114,"context_line":"        # needs - a native string - but we do the encode-decode dance."},{"line_number":115,"context_line":"        path \u003d unquote(request.path)"},{"line_number":116,"context_line":"        if six.PY3:"},{"line_number":117,"context_line":"            path \u003d path.encode(\u0027utf-8\u0027)"},{"line_number":118,"context_line":"        segs \u003d split_path(path,"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_8ae3d134","line":115,"range":{"start_line":115,"start_character":23,"end_line":115,"end_character":35},"updated":"2018-09-12 03:54:41.000000000","message":"OK, and there\u0027s *no chance* that this will have non-ascii characters in it because the last thing request.path does is call urllib.parse.quote().\n\nSorry, I just really worry about passing wsgi strings to unquote (whose default encoding is UTF-8, not Latin-1)...","commit_id":"0ad487331029ef278257e267a5ed9f07d738a6eb"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"db50e65b99d9e46c29e8bcba3604908d0f435104","unresolved":false,"context_lines":[{"line_number":112,"context_line":"        # with bytes only (it needs to compare with b\u0027/\u0027). The unquote()"},{"line_number":113,"context_line":"        # provides us with just the thing that validate_device_partition()"},{"line_number":114,"context_line":"        # needs - a native string - but we do the encode-decode dance."},{"line_number":115,"context_line":"        path \u003d unquote(request.path)"},{"line_number":116,"context_line":"        if six.PY3:"},{"line_number":117,"context_line":"            path \u003d path.encode(\u0027utf-8\u0027)"},{"line_number":118,"context_line":"        segs \u003d split_path(path,"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_5cf015fe","line":115,"range":{"start_line":115,"start_character":23,"end_line":115,"end_character":35},"in_reply_to":"3f79a3b5_85ead7d5","updated":"2018-09-12 17:53:18.000000000","message":"\u003e Frankly I suspect this is even incorrect, if Swift is ever not at the root of host\u0027s namespace (e.g. \"/swift_namespace/v1/account/container\").\n\nAgreed -- I\u0027ve always found that behavior rather worrisome.","commit_id":"0ad487331029ef278257e267a5ed9f07d738a6eb"},{"author":{"_account_id":597,"name":"Pete Zaitcev","email":"zaitcev@kotori.zaitcev.us","username":"zaitcev"},"change_message_id":"6ddf1516e429a23cc5752642d3698d4ac29a9270","unresolved":false,"context_lines":[{"line_number":112,"context_line":"        # with bytes only (it needs to compare with b\u0027/\u0027). The unquote()"},{"line_number":113,"context_line":"        # provides us with just the thing that validate_device_partition()"},{"line_number":114,"context_line":"        # needs - a native string - but we do the encode-decode dance."},{"line_number":115,"context_line":"        path \u003d unquote(request.path)"},{"line_number":116,"context_line":"        if six.PY3:"},{"line_number":117,"context_line":"            path \u003d path.encode(\u0027utf-8\u0027)"},{"line_number":118,"context_line":"        segs \u003d split_path(path,"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_85ead7d5","line":115,"range":{"start_line":115,"start_character":23,"end_line":115,"end_character":35},"in_reply_to":"3f79a3b5_8ae3d134","updated":"2018-09-12 17:00:35.000000000","message":"The rule is that env[] is in WSGI and Request.properties are unicode, unless it\u0027s path_info and script_name, which are encoded. So...\n\nI find it irritating that .path quotes only for the callers to unquote. All they want is script_name and path_info, and then they split_path. Frankly I suspect this is even incorrect, if Swift is ever not at the root of host\u0027s namespace (e.g. \"/swift_namespace/v1/account/container\"). But I don\u0027t want to switch this thing to path_info in this path. Maybe if someone does an unrelated change.","commit_id":"0ad487331029ef278257e267a5ed9f07d738a6eb"}],"swift/common/swob.py":[{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"4fd7143a88eaab320b1fd0c71a29bfe75e1cfe65","unresolved":false,"context_lines":[{"line_number":998,"context_line":"    @property"},{"line_number":999,"context_line":"    def path(self):"},{"line_number":1000,"context_line":"        \"Provides the full path of the request, excluding the QUERY_STRING\""},{"line_number":1001,"context_line":"        return urllib.parse.quote(self.environ.get(\u0027SCRIPT_NAME\u0027, b\u0027\u0027) +"},{"line_number":1002,"context_line":"                                  self.environ[\u0027PATH_INFO\u0027])"},{"line_number":1003,"context_line":""},{"line_number":1004,"context_line":"    @property"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_7fc25155","line":1001,"range":{"start_line":1001,"start_character":66,"end_line":1001,"end_character":69},"updated":"2018-09-04 18:05:05.000000000","message":"Why switch the default to bytes? Won\u0027t the environment still be using WSGI strings?","commit_id":"efc003e0686f9333c90e9865e7d67db983459a5f"},{"author":{"_account_id":597,"name":"Pete Zaitcev","email":"zaitcev@kotori.zaitcev.us","username":"zaitcev"},"change_message_id":"065222e040d5b5ea1b48ea0e2bd3a4b22a4371ba","unresolved":false,"context_lines":[{"line_number":998,"context_line":"    @property"},{"line_number":999,"context_line":"    def path(self):"},{"line_number":1000,"context_line":"        \"Provides the full path of the request, excluding the QUERY_STRING\""},{"line_number":1001,"context_line":"        return urllib.parse.quote(self.environ.get(\u0027SCRIPT_NAME\u0027, b\u0027\u0027) +"},{"line_number":1002,"context_line":"                                  self.environ[\u0027PATH_INFO\u0027])"},{"line_number":1003,"context_line":""},{"line_number":1004,"context_line":"    @property"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_6b6ff327","line":1001,"range":{"start_line":1001,"start_character":66,"end_line":1001,"end_character":69},"in_reply_to":"3f79a3b5_7fc25155","updated":"2018-09-04 20:01:12.000000000","message":"The SCRIPT_NAME and PATH_INFO are only two entries that are enforced, look at the is_bytes_field. That said, what WSGI gives us is not what\u0027s in the environment of Request, see. Instead, it\u0027s what WSGI would give us if it could.","commit_id":"efc003e0686f9333c90e9865e7d67db983459a5f"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"d90848d982dbbd341e05108d8b2e7757932d7613","unresolved":false,"context_lines":[{"line_number":1137,"context_line":"        :raises ValueError: if given an invalid path"},{"line_number":1138,"context_line":"        \"\"\""},{"line_number":1139,"context_line":"        return split_path("},{"line_number":1140,"context_line":"            self.environ.get(\u0027SCRIPT_NAME\u0027, b\u0027\u0027) + self.environ[\u0027PATH_INFO\u0027],"},{"line_number":1141,"context_line":"            minsegs, maxsegs, rest_with_last)"},{"line_number":1142,"context_line":""},{"line_number":1143,"context_line":"    def message_length(self):"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_0a0ca1ea","line":1140,"updated":"2018-09-12 03:54:41.000000000","message":"This still seems weird to me -- if we build a Request from the environ eventlet gives us and call split path, how are we not going to end up in a situation where we try to do\n\n b\u0027\u0027 + \u0027/v1/a/c/o\u0027\n\nand end up throwing a TypeError? Or are we relying on eventlet supplying a blank native string SCRIPT_NAME even when it doesn\u0027t strictly have to supply anything at all according to the spec?","commit_id":"0ad487331029ef278257e267a5ed9f07d738a6eb"},{"author":{"_account_id":597,"name":"Pete Zaitcev","email":"zaitcev@kotori.zaitcev.us","username":"zaitcev"},"change_message_id":"6ddf1516e429a23cc5752642d3698d4ac29a9270","unresolved":false,"context_lines":[{"line_number":1137,"context_line":"        :raises ValueError: if given an invalid path"},{"line_number":1138,"context_line":"        \"\"\""},{"line_number":1139,"context_line":"        return split_path("},{"line_number":1140,"context_line":"            self.environ.get(\u0027SCRIPT_NAME\u0027, b\u0027\u0027) + self.environ[\u0027PATH_INFO\u0027],"},{"line_number":1141,"context_line":"            minsegs, maxsegs, rest_with_last)"},{"line_number":1142,"context_line":""},{"line_number":1143,"context_line":"    def message_length(self):"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_3bebe212","line":1140,"in_reply_to":"3f79a3b5_0a0ca1ea","updated":"2018-09-12 17:00:35.000000000","message":"You\u0027re damn right about this. When we left environ alone, I changed the .path to use attributes, but forgot about .split_path, and the tests didn\u0027t catch it.","commit_id":"0ad487331029ef278257e267a5ed9f07d738a6eb"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"d90848d982dbbd341e05108d8b2e7757932d7613","unresolved":false,"context_lines":[{"line_number":1463,"context_line":"            vrs, realm, rest \u003d self.request.split_path(2, 3, True)"},{"line_number":1464,"context_line":"            if six.PY3:"},{"line_number":1465,"context_line":"                realm \u003d realm.decode(\u0027utf8\u0027)"},{"line_number":1466,"context_line":"            if realm in (\u0027v1.0\u0027, \u0027auth\u0027):"},{"line_number":1467,"context_line":"                realm \u003d \u0027unknown\u0027"},{"line_number":1468,"context_line":"        except (AttributeError, ValueError):"},{"line_number":1469,"context_line":"            realm \u003d \u0027unknown\u0027"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_aafc8db5","line":1466,"range":{"start_line":1466,"start_character":34,"end_line":1466,"end_character":38},"updated":"2018-09-12 03:54:41.000000000","message":"Off-topic: huh, that\u0027s an interesting exception. I guess we assume no one would want to use the account at /v1/auth/?","commit_id":"0ad487331029ef278257e267a5ed9f07d738a6eb"}],"swift/common/utils.py":[{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"d90848d982dbbd341e05108d8b2e7757932d7613","unresolved":false,"context_lines":[{"line_number":665,"context_line":"        if isinstance(iterable, six.binary_type):"},{"line_number":666,"context_line":"            # Unfortunately, next(iter(b\u0027abc\u0027)) returns an int (the value"},{"line_number":667,"context_line":"            # of \u0027a\u0027 in ASCII) in py3. So, we special-case binary strings."},{"line_number":668,"context_line":"            self.iterator \u003d None"},{"line_number":669,"context_line":"            self.buf \u003d iterable"},{"line_number":670,"context_line":"        else:"},{"line_number":671,"context_line":"            self.iterator \u003d iter(iterable)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_6a14d1e9","line":668,"range":{"start_line":668,"start_character":28,"end_line":668,"end_character":32},"updated":"2018-09-12 03:54:41.000000000","message":"Maybe worth setting to\n\n iter(())\n\n? Or we could set\n\n iterable \u003d (iterable, )\n\nand keep __init__ mostly the same otherwise.\n\nJust trying to limit the extent of the special-casing.\n\n*shrug*","commit_id":"efc003e0686f9333c90e9865e7d67db983459a5f"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"d90848d982dbbd341e05108d8b2e7757932d7613","unresolved":false,"context_lines":[{"line_number":670,"context_line":"        else:"},{"line_number":671,"context_line":"            self.iterator \u003d iter(iterable)"},{"line_number":672,"context_line":"            self.buf \u003d None"},{"line_number":673,"context_line":"        self.closed \u003d False"},{"line_number":674,"context_line":""},{"line_number":675,"context_line":"    def __iter__(self):"},{"line_number":676,"context_line":"        return self"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_6a3995a1","line":673,"updated":"2018-09-12 03:54:41.000000000","message":"I think I might still prefer something like\n\n self.buf \u003d None\n if isinstance(iterable, six.binary_type):\n    self.iterator \u003d iter((iterable, ))\n else:\n    self.iterator \u003d iter(iterable)\n self.closed \u003d False\n\nand then we can stop raising StopIteration ourselves or checking whether self.iterator is None.","commit_id":"0ad487331029ef278257e267a5ed9f07d738a6eb"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"d90848d982dbbd341e05108d8b2e7757932d7613","unresolved":false,"context_lines":[{"line_number":1410,"context_line":"        [\u0027a\u0027, \u0027c\u0027] \u003d split_path(\u0027/a/c\u0027, 1, 2)"},{"line_number":1411,"context_line":"        [\u0027a\u0027, \u0027c\u0027, \u0027o/r\u0027] \u003d split_path(\u0027/a/c/o/r\u0027, 1, 3, True)"},{"line_number":1412,"context_line":""},{"line_number":1413,"context_line":"    :param path: HTTP Request path to be split"},{"line_number":1414,"context_line":"    :param minsegs: Minimum number of segments to be extracted"},{"line_number":1415,"context_line":"    :param maxsegs: Maximum number of segments to be extracted"},{"line_number":1416,"context_line":"    :param rest_with_last: If True, trailing data will be returned as part"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_ca47891e","line":1413,"updated":"2018-09-12 03:54:41.000000000","message":"Why does this have to be bytes? Why not native and/or wsgi strings? At the very least, we ought to clarify in the docstring...","commit_id":"0ad487331029ef278257e267a5ed9f07d738a6eb"}],"swift/proxy/controllers/info.py":[{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"d90848d982dbbd341e05108d8b2e7757932d7613","unresolved":false,"context_lines":[{"line_number":70,"context_line":"        # the code below wants the native str, le sigh"},{"line_number":71,"context_line":"        if six.PY3:"},{"line_number":72,"context_line":"            sig \u003d sig.decode(\u0027ascii\u0027, \u0027ignore\u0027)"},{"line_number":73,"context_line":"            expires \u003d expires.decode(\u0027ascii\u0027, \u0027ignore\u0027)"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"        if sig !\u003d \u0027\u0027 or expires !\u003d \u0027\u0027:"},{"line_number":76,"context_line":"            admin_request \u003d True"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_6ad5151b","line":73,"range":{"start_line":73,"start_character":47,"end_line":73,"end_character":53},"updated":"2018-09-12 03:54:41.000000000","message":"I feel like we don\u0027t actually want to ignore -- but we could try/catch and immediately reject any request on a UnicodeDecodeError","commit_id":"0ad487331029ef278257e267a5ed9f07d738a6eb"}],"test/unit/common/test_internal_client.py":[{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"833a1df606cbb9a375ec3dfb6088eb89c9f6b750","unresolved":false,"context_lines":[{"line_number":411,"context_line":"            lambda call: call[0][0], mock_urlopen.call_args_list))"},{"line_number":412,"context_line":"        if six.PY3:"},{"line_number":413,"context_line":"            # The get_selector() method is documented for"},{"line_number":414,"context_line":"            # urllib.request.Request, but... it\u0027s just missing."},{"line_number":415,"context_line":"            self.assertEqual("},{"line_number":416,"context_line":"                \u0027/?format\u003djson\u0027, actual_requests[0].selector)"},{"line_number":417,"context_line":"            self.assertEqual("}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_c732da5e","line":414,"updated":"2018-09-15 07:45:40.000000000","message":"Is it? I saw\n\n\u003e Changed in version 3.4: The request methods add_data, has_data, get_data, get_type, get_host, get_selector, get_origin_req_host and is_unverifiable that were deprecated since 3.3 have been removed.\n\non https://docs.python.org/3/library/urllib.request.html\n\nI still wonder if we should be looking for something else, though... *shrug*","commit_id":"f400a12faaaf6ea93a177bb6446aa534b952cac1"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"833a1df606cbb9a375ec3dfb6088eb89c9f6b750","unresolved":false,"context_lines":[{"line_number":448,"context_line":"        for path in \u0027/one /two/three\u0027.split():"},{"line_number":449,"context_line":"            path_ \u003d path.encode(\u0027ascii\u0027)"},{"line_number":450,"context_line":"            client.make_request(\u0027GET\u0027, path_, {\u0027X-Test\u0027: path}, (200,))"},{"line_number":451,"context_line":"            self.assertEqual(client.env[\u0027PATH_INFO\u0027], path_)"},{"line_number":452,"context_line":"            self.assertEqual(client.env[\u0027HTTP_X_TEST\u0027], path)"},{"line_number":453,"context_line":""},{"line_number":454,"context_line":"    def test_make_request_error_case(self):"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_912747c8","line":451,"range":{"start_line":451,"start_character":54,"end_line":451,"end_character":59},"updated":"2018-09-15 07:45:40.000000000","message":"This makes me nervous -- WSGI expects native strings here... will a py3 WSGI server know what to do with bytes?","commit_id":"f400a12faaaf6ea93a177bb6446aa534b952cac1"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"833a1df606cbb9a375ec3dfb6088eb89c9f6b750","unresolved":false,"context_lines":[{"line_number":1622,"context_line":"                    # the urlopen() is called with the req.type of the target"},{"line_number":1623,"context_line":"                    # URL, even when we\u0027re connecting to the proxy."},{"line_number":1624,"context_line":"                    # XXX Maybe we should investigate the source, file bugs?"},{"line_number":1625,"context_line":"                    self.assertEqual(\u0027https\u0027, args[0].type)"},{"line_number":1626,"context_line":""},{"line_number":1627,"context_line":"        # class methods"},{"line_number":1628,"context_line":"        content \u003d mock.MagicMock()"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_a78d5e36","line":1625,"updated":"2018-09-15 07:45:40.000000000","message":"I almost didn\u0027t notice this... very strange. Seems likely to have been introduced with https://github.com/python/cpython/commit/6c5e28c and a _parse function that would always get called during Request.__init__()\n\nThis became less obvious with https://github.com/python/cpython/commit/5238092 but sure enough, if you look at (_tunnel_host, host, type) before and after calling set_proxy, on py27 you get\n\n _tunnel_host, host, type: None, None, None\n setting proxy: \u0027127.0.0.1:80\u0027, \u0027http\u0027\n _tunnel_host, host, type: None, \u0027127.0.0.1:80\u0027, \u0027http\u0027\n\nwhile on py35 you get\n\n _tunnel_host, host, type: None, \u0027127.0.0.1:1\u0027, \u0027https\u0027\n setting proxy: \u0027127.0.0.1:80\u0027, \u0027http\u0027\n _tunnel_host, host, type: \u0027127.0.0.1:1\u0027, \u0027127.0.0.1:80\u0027, \u0027https\u0027\n\nI have no idea which is right or why, or even why CPython has that\n\n if self.type \u003d\u003d \u0027https\u0027 and not self._tunnel_host:\n     # Don\u0027t update type\n\nin set_proxy :-/","commit_id":"f400a12faaaf6ea93a177bb6446aa534b952cac1"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"b211e20623230c18dd8ad4e545b1184531942cad","unresolved":false,"context_lines":[{"line_number":1622,"context_line":"                    # the urlopen() is called with the req.type of the target"},{"line_number":1623,"context_line":"                    # URL, even when we\u0027re connecting to the proxy."},{"line_number":1624,"context_line":"                    # XXX Maybe we should investigate the source, file bugs?"},{"line_number":1625,"context_line":"                    self.assertEqual(\u0027https\u0027, args[0].type)"},{"line_number":1626,"context_line":""},{"line_number":1627,"context_line":"        # class methods"},{"line_number":1628,"context_line":"        content \u003d mock.MagicMock()"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_4f702041","line":1625,"in_reply_to":"3f79a3b5_a78d5e36","updated":"2018-09-15 17:20:39.000000000","message":"Created https://bugs.python.org/issue34698 to try to get some clarification.","commit_id":"f400a12faaaf6ea93a177bb6446aa534b952cac1"}]}
