)]}'
{"nova/api/openstack/placement/handler.py":[{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"423c0b5e9b5cb7c468f5061ae6ca6009d5936f27","unresolved":false,"context_lines":[{"line_number":111,"context_line":"        # not unicode in python 2 but stay a string in python 3)"},{"line_number":112,"context_line":"        # In the process done by Routes to save the allowed methods"},{"line_number":113,"context_line":"        # to its routing table they become unicode in py2."},{"line_number":114,"context_line":"        headers[\u0027allow\u0027] \u003d str(_methods)"},{"line_number":115,"context_line":"    raise webob.exc.HTTPMethodNotAllowed("},{"line_number":116,"context_line":"        _(\u0027The method specified is not allowed for this resource.\u0027),"},{"line_number":117,"context_line":"        headers\u003dheaders, json_formatter\u003dutil.json_error_formatter)"}],"source_content_type":"text/x-python","patch_set":7,"id":"3a98d1f4_481125ac","line":114,"updated":"2016-09-28 17:27:09.000000000","message":"I don\u0027t think that this is correct in Python 3. See: http://paste.openstack.org/show/583352/. If you get bytes back in Python3 (the rough equivalent to unicode strings in Python2), you\u0027ll have to decode it, meaning you\u0027ll have to know the encoding. The only alternative I see is to check if the result of str(_methods) matches the regex r\"b\u0027([^\u0027]*)\u0027\", and return the matched group.","commit_id":"5fdb9226d269af069bfcbd42cff401c9d089b7dd"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"59219ea6e9a5b0d0906c0035f194037ad0ecca8c","unresolved":false,"context_lines":[{"line_number":111,"context_line":"        # not unicode in python 2 but stay a string in python 3)"},{"line_number":112,"context_line":"        # In the process done by Routes to save the allowed methods"},{"line_number":113,"context_line":"        # to its routing table they become unicode in py2."},{"line_number":114,"context_line":"        headers[\u0027allow\u0027] \u003d str(_methods)"},{"line_number":115,"context_line":"    raise webob.exc.HTTPMethodNotAllowed("},{"line_number":116,"context_line":"        _(\u0027The method specified is not allowed for this resource.\u0027),"},{"line_number":117,"context_line":"        headers\u003dheaders, json_formatter\u003dutil.json_error_formatter)"}],"source_content_type":"text/x-python","patch_set":7,"id":"3a98d1f4_58357044","line":114,"in_reply_to":"3a98d1f4_037e1ee4","updated":"2016-09-28 18:22:22.000000000","message":"I don\u0027t know the Routes internals that well; my concern is based on Python handling of these types in general. It seems odd that Routes would take a decoded string in Python2 and encode it, but not do the same in Python3.","commit_id":"5fdb9226d269af069bfcbd42cff401c9d089b7dd"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"6dcf2508d748dd611b268ae793dcb319ac93dbc1","unresolved":false,"context_lines":[{"line_number":111,"context_line":"        # not unicode in python 2 but stay a string in python 3)"},{"line_number":112,"context_line":"        # In the process done by Routes to save the allowed methods"},{"line_number":113,"context_line":"        # to its routing table they become unicode in py2."},{"line_number":114,"context_line":"        headers[\u0027allow\u0027] \u003d str(_methods)"},{"line_number":115,"context_line":"    raise webob.exc.HTTPMethodNotAllowed("},{"line_number":116,"context_line":"        _(\u0027The method specified is not allowed for this resource.\u0027),"},{"line_number":117,"context_line":"        headers\u003dheaders, json_formatter\u003dutil.json_error_formatter)"}],"source_content_type":"text/x-python","patch_set":7,"id":"3a98d1f4_037e1ee4","line":114,"in_reply_to":"3a98d1f4_481125ac","updated":"2016-09-28 17:48:58.000000000","message":"Were the possible values of _methods unconstrained I\u0027d say yeah, but in this case the values are constructed from the strings that are request methods in ROUTE_DECLARATIONS\n\nThe process done by Routes is transforming the str -\u003e unicode. In Python3 it is str -\u003e str. If that process changes for some reason (e.g., a Routes upgrade) then the gabbi tests which check the 405 response and the allow header will fail.\n\nSo, to my mind this is correct in that it will fail when things change in unexpected ways, and when it does we can fix it, with awareness of that change, rather than predicting that wrongness.","commit_id":"5fdb9226d269af069bfcbd42cff401c9d089b7dd"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"c545aee39e9ab0d59957387ac3f3eb2072cbf4fc","unresolved":false,"context_lines":[{"line_number":111,"context_line":"        # not unicode in python 2 but stay a string in python 3)"},{"line_number":112,"context_line":"        # In the process done by Routes to save the allowed methods"},{"line_number":113,"context_line":"        # to its routing table they become unicode in py2."},{"line_number":114,"context_line":"        headers[\u0027allow\u0027] \u003d str(_methods)"},{"line_number":115,"context_line":"    raise webob.exc.HTTPMethodNotAllowed("},{"line_number":116,"context_line":"        _(\u0027The method specified is not allowed for this resource.\u0027),"},{"line_number":117,"context_line":"        headers\u003dheaders, json_formatter\u003dutil.json_error_formatter)"}],"source_content_type":"text/x-python","patch_set":7,"id":"3a98d1f4_cb49acd2","line":114,"in_reply_to":"3a98d1f4_58357044","updated":"2016-09-28 18:41:02.000000000","message":"Routes is taking a thing which is provided as `str` and turning it into a `unicode` in Python 2. In Python 3 it is staying `str`:\n\nBasically anything that is passed in as a custome keyword when making the map is passed through the make_unicode method which turns what it gets into the local six.text_type.\n\nThis is happening at: https://github.com/bbangert/routes/blob/b4ffdf7289f3a502e0972ce217c5eeb42345b2da/routes/route.py#L136\n\nThat\u0027s a process that happens as a result of a Routes object being created which happens when our code here calls\n\n            mapper.connect(route, action\u003dhandle_405, _methods\u003dallowed_methods)\n\nThat _methods is a custom keyword arg whose values go to make_unicode.\n\nDoes that make any more sense?","commit_id":"5fdb9226d269af069bfcbd42cff401c9d089b7dd"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"31092fc0007ea091da972a910b4407ebf9f04abd","unresolved":false,"context_lines":[{"line_number":111,"context_line":"        # not unicode in python 2 but stay a string in python 3)"},{"line_number":112,"context_line":"        # In the process done by Routes to save the allowed methods"},{"line_number":113,"context_line":"        # to its routing table they become unicode in py2."},{"line_number":114,"context_line":"        headers[\u0027allow\u0027] \u003d str(_methods)"},{"line_number":115,"context_line":"    raise webob.exc.HTTPMethodNotAllowed("},{"line_number":116,"context_line":"        _(\u0027The method specified is not allowed for this resource.\u0027),"},{"line_number":117,"context_line":"        headers\u003dheaders, json_formatter\u003dutil.json_error_formatter)"}],"source_content_type":"text/x-python","patch_set":7,"id":"3a98d1f4_e952f0dc","line":114,"in_reply_to":"3a98d1f4_cb49acd2","updated":"2016-09-28 19:22:38.000000000","message":"OK, I guess. Seems a bit fragile, but I guess it\u0027s ok.","commit_id":"5fdb9226d269af069bfcbd42cff401c9d089b7dd"}],"test-requirements.txt":[{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"18b1580f192050124ec5d00578641359e3756285","unresolved":false,"context_lines":[{"line_number":33,"context_line":"reno\u003e\u003d1.8.0 # Apache2"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"# placement functional tests"},{"line_number":36,"context_line":"wsgi-intercept\u003e\u003d1.4.1 # MIT License"}],"source_content_type":"text/plain","patch_set":7,"id":"1a95cdbc_95065d1b","line":36,"updated":"2016-10-07 10:41:08.000000000","message":"That seems allowed:\nhttps://github.com/openstack/requirements/blob/master/global-requirements.txt#L378","commit_id":"5fdb9226d269af069bfcbd42cff401c9d089b7dd"}]}
