)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":13478,"name":"Boris Bobrov","email":"b.bobrov@sap.com","username":"bbobrov"},"change_message_id":"f62efd2cf4916754f762d574c7383bbbcfd149d4","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Convert unicode to str when creating a fernet token"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Some changes were did to fix fernet padding for python3 [1],"},{"line_number":10,"context_line":"fernet payload is decoded to str after encryption when"},{"line_number":11,"context_line":"creating a ferent token. But it will be unicode instead on"},{"line_number":12,"context_line":"python27 and this is not compatible with mod_wsgi."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"1a7b0d38_a2b08344","line":9,"range":{"start_line":9,"start_character":13,"end_line":9,"end_character":21},"updated":"2015-12-24 07:24:28.000000000","message":"sorry, \"were made\"","commit_id":"8d99af84fc16a3606e59767c6687d779c014e16b"},{"author":{"_account_id":13063,"name":"WEI CHEN","email":"dave.jungler@gmail.com","username":"wei.d.chen"},"change_message_id":"e066420b17f63bcecddf3b6afced1c18617f8280","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Convert unicode to str when creating a fernet token"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Some changes were did to fix fernet padding for python3 [1],"},{"line_number":10,"context_line":"fernet payload is decoded to str after encryption when"},{"line_number":11,"context_line":"creating a ferent token. But it will be unicode instead on"},{"line_number":12,"context_line":"python27 and this is not compatible with mod_wsgi."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"1a7b0d38_021077a7","line":9,"range":{"start_line":9,"start_character":13,"end_line":9,"end_character":21},"in_reply_to":"1a7b0d38_a2b08344","updated":"2015-12-24 07:43:54.000000000","message":"i saw no difference here. :)","commit_id":"8d99af84fc16a3606e59767c6687d779c014e16b"},{"author":{"_account_id":13478,"name":"Boris Bobrov","email":"b.bobrov@sap.com","username":"bbobrov"},"change_message_id":"f62efd2cf4916754f762d574c7383bbbcfd149d4","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Some changes were did to fix fernet padding for python3 [1],"},{"line_number":10,"context_line":"fernet payload is decoded to str after encryption when"},{"line_number":11,"context_line":"creating a ferent token. But it will be unicode instead on"},{"line_number":12,"context_line":"python27 and this is not compatible with mod_wsgi."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"This patch simply convert the unicode to str if on python27."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"1a7b0d38_62ba9b25","line":11,"range":{"start_line":11,"start_character":11,"end_line":11,"end_character":17},"updated":"2015-12-24 07:24:28.000000000","message":"fernet","commit_id":"8d99af84fc16a3606e59767c6687d779c014e16b"},{"author":{"_account_id":13063,"name":"WEI CHEN","email":"dave.jungler@gmail.com","username":"wei.d.chen"},"change_message_id":"bb103bb670b3e342666fe368e5856b459326ff6c","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Some changes were did to fix fernet padding for python3 [1],"},{"line_number":10,"context_line":"fernet payload is decoded to str after encryption when"},{"line_number":11,"context_line":"creating a ferent token. But it will be unicode instead on"},{"line_number":12,"context_line":"python27 and this is not compatible with mod_wsgi."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"This patch simply convert the unicode to str if on python27."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"1a7b0d38_22c81322","line":11,"range":{"start_line":11,"start_character":11,"end_line":11,"end_character":17},"in_reply_to":"1a7b0d38_62ba9b25","updated":"2015-12-24 07:47:54.000000000","message":"Done","commit_id":"8d99af84fc16a3606e59767c6687d779c014e16b"},{"author":{"_account_id":19779,"name":"Chason Chan","display_name":"chenxing","email":"chason.chan@foxmail.com","username":"chenxing"},"change_message_id":"af1860aee39ccafa074471b6ba77ead7eeb083cf","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Dave Chen \u003cwei.d.chen@intel.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2015-12-24 15:40:19 +0800"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Convert unicode to str when creating a fernet token"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Some changes were made to fix fernet padding for python3 [1],"},{"line_number":10,"context_line":"fernet payload is decoded to str after encryption when"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"1a7b0d38_e53bf5e9","line":7,"range":{"start_line":7,"start_character":19,"end_line":7,"end_character":22},"updated":"2015-12-24 08:50:32.000000000","message":"\"string\"","commit_id":"2000dcd0a96a1ab5e4fc3247960a0876d7ed8d68"},{"author":{"_account_id":13063,"name":"WEI CHEN","email":"dave.jungler@gmail.com","username":"wei.d.chen"},"change_message_id":"c0fa1488fb463cc3d5ddbbf35cb2eb90e2fd9a1c","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Dave Chen \u003cwei.d.chen@intel.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2015-12-24 15:40:19 +0800"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Convert unicode to str when creating a fernet token"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Some changes were made to fix fernet padding for python3 [1],"},{"line_number":10,"context_line":"fernet payload is decoded to str after encryption when"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"1a7b0d38_c07d871d","line":7,"range":{"start_line":7,"start_character":19,"end_line":7,"end_character":22},"in_reply_to":"1a7b0d38_e53bf5e9","updated":"2015-12-24 08:57:08.000000000","message":"`str` is the a python built in type, why need change this to string?","commit_id":"2000dcd0a96a1ab5e4fc3247960a0876d7ed8d68"},{"author":{"_account_id":19779,"name":"Chason Chan","display_name":"chenxing","email":"chason.chan@foxmail.com","username":"chenxing"},"change_message_id":"af1860aee39ccafa074471b6ba77ead7eeb083cf","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Convert unicode to str when creating a fernet token"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Some changes were made to fix fernet padding for python3 [1],"},{"line_number":10,"context_line":"fernet payload is decoded to str after encryption when"},{"line_number":11,"context_line":"creating a fernet token. But it will be unicode instead on"},{"line_number":12,"context_line":"python27 and this is not compatible with mod_wsgi."},{"line_number":13,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"1a7b0d38_80353fdb","line":10,"range":{"start_line":10,"start_character":29,"end_line":10,"end_character":32},"updated":"2015-12-24 08:50:32.000000000","message":"ditto","commit_id":"2000dcd0a96a1ab5e4fc3247960a0876d7ed8d68"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"05ac89d6e440d8cb67464ed678f71a2ceebd49ac","unresolved":false,"context_lines":[{"line_number":9,"context_line":"Some changes were made to fix fernet padding for python3 [1],"},{"line_number":10,"context_line":"fernet payload is decoded to str after encryption when"},{"line_number":11,"context_line":"creating a fernet token. But it will be unicode instead on"},{"line_number":12,"context_line":"python27 and this is not compatible with mod_wsgi."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"This patch simply convert the unicode to str if on python27."},{"line_number":15,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"1a7b0d38_34911f9a","line":12,"updated":"2015-12-24 15:44:48.000000000","message":"The translation should be done wherever the code deals with mod_wsgi, not way down in the token formatter.","commit_id":"2000dcd0a96a1ab5e4fc3247960a0876d7ed8d68"},{"author":{"_account_id":19779,"name":"Chason Chan","display_name":"chenxing","email":"chason.chan@foxmail.com","username":"chenxing"},"change_message_id":"af1860aee39ccafa074471b6ba77ead7eeb083cf","unresolved":false,"context_lines":[{"line_number":11,"context_line":"creating a fernet token. But it will be unicode instead on"},{"line_number":12,"context_line":"python27 and this is not compatible with mod_wsgi."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"This patch simply convert the unicode to str if on python27."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"[1] https://review.openstack.org/#/c/231711/"},{"line_number":17,"context_line":"Closes-Bug: #1528981"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"1a7b0d38_20248bad","line":14,"range":{"start_line":14,"start_character":41,"end_line":14,"end_character":44},"updated":"2015-12-24 08:50:32.000000000","message":"ditto","commit_id":"2000dcd0a96a1ab5e4fc3247960a0876d7ed8d68"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"552b9a527a1daafdee7bea60609f0c790524c1b3","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Fix the incompatible issue in response header"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Some changes were made to fix fernet padding for python3 [1],"},{"line_number":10,"context_line":"fernet payload is decoded to str after encryption when"},{"line_number":11,"context_line":"creating a fernet token. But it will be unicode string on"},{"line_number":12,"context_line":"python27 and this is not compatible with `mod_wsgi`."},{"line_number":13,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"fa69d971_a7577dc9","line":10,"updated":"2015-12-29 23:09:29.000000000","message":"suggest change str to six.text_type","commit_id":"02b3eb869d6c8f490e5aded90f9a55c5f49572fb"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"9ceb7a8ff873f6bd6f00c2075a84bc2c10e8485a","unresolved":false,"context_lines":[{"line_number":9,"context_line":"Some changes were made to fix fernet padding for python3 [1],"},{"line_number":10,"context_line":"fernet payload is decoded to str after encryption when"},{"line_number":11,"context_line":"creating a fernet token. But it will be unicode string on"},{"line_number":12,"context_line":"python27 and this is not compatible with `mod_wsgi`."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"`mod_wsgi` needs the value in the response headers is binary(str)"},{"line_number":15,"context_line":"type on python2, and unicode(str) type on python3. This patch"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"fa69d971_2593535d","line":12,"updated":"2015-12-31 14:33:21.000000000","message":"we shouldn\u0027t be coding keystone to work with mod_wsgi, but instead with the wsgi standard. Reference  https://www.python.org/dev/peps/pep-3333/#a-note-on-string-types","commit_id":"5b445469b6369fe991f725b90833c54f399ab350"}],"keystone/common/wsgi.py":[{"author":{"_account_id":6482,"name":"Steve Martinelli","email":"s.martinelli@gmail.com","username":"stevemar"},"change_message_id":"ac8db3c1196ab4ae232a2a96e53894b094cd2212","unresolved":false,"context_lines":[{"line_number":743,"context_line":"                headers.append((\u0027Content-Type\u0027, \u0027application/json\u0027))"},{"line_number":744,"context_line":"        status \u003d status or (200, \u0027OK\u0027)"},{"line_number":745,"context_line":""},{"line_number":746,"context_line":"    # NOTE(davechen): `mod_wsgi` needs the value in response header is binary"},{"line_number":747,"context_line":"    # type(str) on python2, and unicode string(str) on python3, or else"},{"line_number":748,"context_line":"    # mod_wsgi will fail and keystone will be broken."},{"line_number":749,"context_line":"    # keystone needs check the data type of each header and convert the type"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a7b0d38_5b907843","line":746,"range":{"start_line":746,"start_character":43,"end_line":746,"end_character":77},"updated":"2015-12-26 08:40:15.000000000","message":"\"value in response header *to be* binary...\"","commit_id":"28f07bed3fa0b9e7a90bf24676e8fa016d4c3d09"},{"author":{"_account_id":13063,"name":"WEI CHEN","email":"dave.jungler@gmail.com","username":"wei.d.chen"},"change_message_id":"b4d838041fd3ba67f9884289a3604cd867239792","unresolved":false,"context_lines":[{"line_number":743,"context_line":"                headers.append((\u0027Content-Type\u0027, \u0027application/json\u0027))"},{"line_number":744,"context_line":"        status \u003d status or (200, \u0027OK\u0027)"},{"line_number":745,"context_line":""},{"line_number":746,"context_line":"    # NOTE(davechen): `mod_wsgi` needs the value in response header is binary"},{"line_number":747,"context_line":"    # type(str) on python2, and unicode string(str) on python3, or else"},{"line_number":748,"context_line":"    # mod_wsgi will fail and keystone will be broken."},{"line_number":749,"context_line":"    # keystone needs check the data type of each header and convert the type"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a7b0d38_7608eb91","line":746,"range":{"start_line":746,"start_character":43,"end_line":746,"end_character":77},"in_reply_to":"1a7b0d38_5b907843","updated":"2015-12-26 09:56:13.000000000","message":"Done","commit_id":"28f07bed3fa0b9e7a90bf24676e8fa016d4c3d09"},{"author":{"_account_id":6482,"name":"Steve Martinelli","email":"s.martinelli@gmail.com","username":"stevemar"},"change_message_id":"ac8db3c1196ab4ae232a2a96e53894b094cd2212","unresolved":false,"context_lines":[{"line_number":745,"context_line":""},{"line_number":746,"context_line":"    # NOTE(davechen): `mod_wsgi` needs the value in response header is binary"},{"line_number":747,"context_line":"    # type(str) on python2, and unicode string(str) on python3, or else"},{"line_number":748,"context_line":"    # mod_wsgi will fail and keystone will be broken."},{"line_number":749,"context_line":"    # keystone needs check the data type of each header and convert the type"},{"line_number":750,"context_line":"    # if needed."},{"line_number":751,"context_line":"    # see bug: https://bugs.launchpad.net/keystone/+bug/1528981,"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a7b0d38_dba468a7","line":748,"range":{"start_line":748,"start_character":38,"end_line":748,"end_character":52},"updated":"2015-12-26 08:40:15.000000000","message":"instead of \"mod_wsgi will fail and keystone will be broken\" how about \"Fernet tokens will be unusable in keystone and mod_wsgi\"","commit_id":"28f07bed3fa0b9e7a90bf24676e8fa016d4c3d09"},{"author":{"_account_id":13063,"name":"WEI CHEN","email":"dave.jungler@gmail.com","username":"wei.d.chen"},"change_message_id":"b4d838041fd3ba67f9884289a3604cd867239792","unresolved":false,"context_lines":[{"line_number":745,"context_line":""},{"line_number":746,"context_line":"    # NOTE(davechen): `mod_wsgi` needs the value in response header is binary"},{"line_number":747,"context_line":"    # type(str) on python2, and unicode string(str) on python3, or else"},{"line_number":748,"context_line":"    # mod_wsgi will fail and keystone will be broken."},{"line_number":749,"context_line":"    # keystone needs check the data type of each header and convert the type"},{"line_number":750,"context_line":"    # if needed."},{"line_number":751,"context_line":"    # see bug: https://bugs.launchpad.net/keystone/+bug/1528981,"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a7b0d38_96f3179e","line":748,"range":{"start_line":748,"start_character":38,"end_line":748,"end_character":52},"in_reply_to":"1a7b0d38_dba468a7","updated":"2015-12-26 09:56:13.000000000","message":"steve, the change is now given in the wsgi application. it turn out to be not ferent specific fixing and if there is a similar issue elsewhere these code will make sure keystone will still work. let\u0027s not mention \u0027fernet\u0027 here.","commit_id":"28f07bed3fa0b9e7a90bf24676e8fa016d4c3d09"},{"author":{"_account_id":6482,"name":"Steve Martinelli","email":"s.martinelli@gmail.com","username":"stevemar"},"change_message_id":"ac8db3c1196ab4ae232a2a96e53894b094cd2212","unresolved":false,"context_lines":[{"line_number":746,"context_line":"    # NOTE(davechen): `mod_wsgi` needs the value in response header is binary"},{"line_number":747,"context_line":"    # type(str) on python2, and unicode string(str) on python3, or else"},{"line_number":748,"context_line":"    # mod_wsgi will fail and keystone will be broken."},{"line_number":749,"context_line":"    # keystone needs check the data type of each header and convert the type"},{"line_number":750,"context_line":"    # if needed."},{"line_number":751,"context_line":"    # see bug: https://bugs.launchpad.net/keystone/+bug/1528981,"},{"line_number":752,"context_line":"    # and the method definition of wsgi_convert_headers_to_bytes(...),"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a7b0d38_7bba14c2","line":749,"range":{"start_line":749,"start_character":15,"end_line":749,"end_character":26},"updated":"2015-12-26 08:40:15.000000000","message":"needs *to* check","commit_id":"28f07bed3fa0b9e7a90bf24676e8fa016d4c3d09"},{"author":{"_account_id":13063,"name":"WEI CHEN","email":"dave.jungler@gmail.com","username":"wei.d.chen"},"change_message_id":"b4d838041fd3ba67f9884289a3604cd867239792","unresolved":false,"context_lines":[{"line_number":746,"context_line":"    # NOTE(davechen): `mod_wsgi` needs the value in response header is binary"},{"line_number":747,"context_line":"    # type(str) on python2, and unicode string(str) on python3, or else"},{"line_number":748,"context_line":"    # mod_wsgi will fail and keystone will be broken."},{"line_number":749,"context_line":"    # keystone needs check the data type of each header and convert the type"},{"line_number":750,"context_line":"    # if needed."},{"line_number":751,"context_line":"    # see bug: https://bugs.launchpad.net/keystone/+bug/1528981,"},{"line_number":752,"context_line":"    # and the method definition of wsgi_convert_headers_to_bytes(...),"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a7b0d38_76646b48","line":749,"range":{"start_line":749,"start_character":15,"end_line":749,"end_character":26},"in_reply_to":"1a7b0d38_7bba14c2","updated":"2015-12-26 09:56:13.000000000","message":"Done","commit_id":"28f07bed3fa0b9e7a90bf24676e8fa016d4c3d09"},{"author":{"_account_id":6482,"name":"Steve Martinelli","email":"s.martinelli@gmail.com","username":"stevemar"},"change_message_id":"ac8db3c1196ab4ae232a2a96e53894b094cd2212","unresolved":false,"context_lines":[{"line_number":749,"context_line":"    # keystone needs check the data type of each header and convert the type"},{"line_number":750,"context_line":"    # if needed."},{"line_number":751,"context_line":"    # see bug: https://bugs.launchpad.net/keystone/+bug/1528981,"},{"line_number":752,"context_line":"    # and the method definition of wsgi_convert_headers_to_bytes(...),"},{"line_number":753,"context_line":"    # wsgi_convert_string_to_bytes(...) and wsgi_validate_header_value(...)"},{"line_number":754,"context_line":"    # from `mod_wsgi` for the details."},{"line_number":755,"context_line":"    def _convert_to_str(headers):"},{"line_number":756,"context_line":"        str_headers \u003d []"},{"line_number":757,"context_line":"        for header in headers:"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a7b0d38_5bb718d8","line":754,"range":{"start_line":752,"start_character":5,"end_line":754,"end_character":38},"updated":"2015-12-26 08:40:15.000000000","message":"Include a link to the mod_wsgi source, since these are functions in mod_wsgi","commit_id":"28f07bed3fa0b9e7a90bf24676e8fa016d4c3d09"},{"author":{"_account_id":13063,"name":"WEI CHEN","email":"dave.jungler@gmail.com","username":"wei.d.chen"},"change_message_id":"b4d838041fd3ba67f9884289a3604cd867239792","unresolved":false,"context_lines":[{"line_number":749,"context_line":"    # keystone needs check the data type of each header and convert the type"},{"line_number":750,"context_line":"    # if needed."},{"line_number":751,"context_line":"    # see bug: https://bugs.launchpad.net/keystone/+bug/1528981,"},{"line_number":752,"context_line":"    # and the method definition of wsgi_convert_headers_to_bytes(...),"},{"line_number":753,"context_line":"    # wsgi_convert_string_to_bytes(...) and wsgi_validate_header_value(...)"},{"line_number":754,"context_line":"    # from `mod_wsgi` for the details."},{"line_number":755,"context_line":"    def _convert_to_str(headers):"},{"line_number":756,"context_line":"        str_headers \u003d []"},{"line_number":757,"context_line":"        for header in headers:"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a7b0d38_165ba788","line":754,"range":{"start_line":752,"start_character":5,"end_line":754,"end_character":38},"in_reply_to":"1a7b0d38_5bb718d8","updated":"2015-12-26 09:56:13.000000000","message":"Done","commit_id":"28f07bed3fa0b9e7a90bf24676e8fa016d4c3d09"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"552b9a527a1daafdee7bea60609f0c790524c1b3","unresolved":false,"context_lines":[{"line_number":743,"context_line":"                headers.append((\u0027Content-Type\u0027, \u0027application/json\u0027))"},{"line_number":744,"context_line":"        status \u003d status or (200, \u0027OK\u0027)"},{"line_number":745,"context_line":""},{"line_number":746,"context_line":"    # NOTE(davechen): `mod_wsgi` needs the value in response header to be"},{"line_number":747,"context_line":"    # binary type(str) on python2, and unicode string(str) on python3, or else"},{"line_number":748,"context_line":"    # `mod_wsgi` will fail and keystone will not work as expected."},{"line_number":749,"context_line":"    # keystone needs to check the data type of each header and convert the"}],"source_content_type":"text/x-python","patch_set":8,"id":"fa69d971_6720a54a","line":746,"updated":"2015-12-29 23:09:29.000000000","message":"we shouldn\u0027t be coding keystone to mod_wsgi, we should be coding it to the wsgi standard. What does the standard say?\n\nIf we need to do something for mod_wsgi, let\u0027s do it in a filter in the paste pipeline instead.","commit_id":"02b3eb869d6c8f490e5aded90f9a55c5f49572fb"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"4105c215ef45c13735949b4fe574f8a6b6c5f945","unresolved":false,"context_lines":[{"line_number":743,"context_line":"                headers.append((\u0027Content-Type\u0027, \u0027application/json\u0027))"},{"line_number":744,"context_line":"        status \u003d status or (200, \u0027OK\u0027)"},{"line_number":745,"context_line":""},{"line_number":746,"context_line":"    # NOTE(davechen): `mod_wsgi` needs the value in response header to be"},{"line_number":747,"context_line":"    # binary type(str) on python2, and unicode string(str) on python3, or else"},{"line_number":748,"context_line":"    # `mod_wsgi` will fail and keystone will not work as expected."},{"line_number":749,"context_line":"    # keystone needs to check the data type of each header and convert the"}],"source_content_type":"text/x-python","patch_set":8,"id":"fa69d971_6795053f","line":746,"in_reply_to":"fa69d971_47eec1ed","updated":"2015-12-29 23:16:23.000000000","message":"Also, https://www.python.org/dev/peps/pep-3333/#a-note-on-string-types\n\nThis seems to indicate that the headers should be six.binary_type in either PY2 or PY3.","commit_id":"02b3eb869d6c8f490e5aded90f9a55c5f49572fb"},{"author":{"_account_id":13063,"name":"WEI CHEN","email":"dave.jungler@gmail.com","username":"wei.d.chen"},"change_message_id":"cee18d21977fcb21241b0c388ba3bc79df821a68","unresolved":false,"context_lines":[{"line_number":743,"context_line":"                headers.append((\u0027Content-Type\u0027, \u0027application/json\u0027))"},{"line_number":744,"context_line":"        status \u003d status or (200, \u0027OK\u0027)"},{"line_number":745,"context_line":""},{"line_number":746,"context_line":"    # NOTE(davechen): `mod_wsgi` needs the value in response header to be"},{"line_number":747,"context_line":"    # binary type(str) on python2, and unicode string(str) on python3, or else"},{"line_number":748,"context_line":"    # `mod_wsgi` will fail and keystone will not work as expected."},{"line_number":749,"context_line":"    # keystone needs to check the data type of each header and convert the"}],"source_content_type":"text/x-python","patch_set":8,"id":"fa69d971_e5afad92","line":746,"in_reply_to":"fa69d971_47eec1ed","updated":"2015-12-30 02:31:37.000000000","message":"Quote from this section:\n\nAll encoding/decoding must be handled by the application; all strings passed to or from the server must be of type str or bytes , never unicode .\n\n\nIt is saying all strings passed to or from must *str* or bytes. Is there anything wrong to use type str?","commit_id":"02b3eb869d6c8f490e5aded90f9a55c5f49572fb"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"f53a07dc025d9cd2f97f2c56ae95452044949de5","unresolved":false,"context_lines":[{"line_number":743,"context_line":"                headers.append((\u0027Content-Type\u0027, \u0027application/json\u0027))"},{"line_number":744,"context_line":"        status \u003d status or (200, \u0027OK\u0027)"},{"line_number":745,"context_line":""},{"line_number":746,"context_line":"    # NOTE(davechen): `mod_wsgi` needs the value in response header to be"},{"line_number":747,"context_line":"    # binary type(str) on python2, and unicode string(str) on python3, or else"},{"line_number":748,"context_line":"    # `mod_wsgi` will fail and keystone will not work as expected."},{"line_number":749,"context_line":"    # keystone needs to check the data type of each header and convert the"}],"source_content_type":"text/x-python","patch_set":8,"id":"fa69d971_47eec1ed","line":746,"in_reply_to":"fa69d971_6720a54a","updated":"2015-12-29 23:10:58.000000000","message":"I think this is the section: https://www.python.org/dev/peps/pep-3333/#unicode-issues","commit_id":"02b3eb869d6c8f490e5aded90f9a55c5f49572fb"},{"author":{"_account_id":13063,"name":"WEI CHEN","email":"dave.jungler@gmail.com","username":"wei.d.chen"},"change_message_id":"cee18d21977fcb21241b0c388ba3bc79df821a68","unresolved":false,"context_lines":[{"line_number":743,"context_line":"                headers.append((\u0027Content-Type\u0027, \u0027application/json\u0027))"},{"line_number":744,"context_line":"        status \u003d status or (200, \u0027OK\u0027)"},{"line_number":745,"context_line":""},{"line_number":746,"context_line":"    # NOTE(davechen): `mod_wsgi` needs the value in response header to be"},{"line_number":747,"context_line":"    # binary type(str) on python2, and unicode string(str) on python3, or else"},{"line_number":748,"context_line":"    # `mod_wsgi` will fail and keystone will not work as expected."},{"line_number":749,"context_line":"    # keystone needs to check the data type of each header and convert the"}],"source_content_type":"text/x-python","patch_set":8,"id":"fa69d971_45f1d9cc","line":746,"in_reply_to":"fa69d971_6795053f","updated":"2015-12-30 02:31:37.000000000","message":"I am misunderstanding about this from this doc?\n\nQuote from pep-3333:\n\nWSGI therefore defines two kinds of \"string\":\n\n\"Native\" strings (which are always implemented using the type named str ) that are used for request/response headers and metadata\n\"Bytestrings\" (which are implemented using the bytes type in Python 3, and str elsewhere), that are used for the bodies of requests and responses (e.g. POST/PUT input data and HTML page outputs).\n\n\nWe are handling with the headers instead of body, all we should do is making sure it is \"Native\" strings, right?\n\n\nQuote from pep-3333:\n\nDo not be confused however: even if Python\u0027s str type is actually Unicode \"under the hood\", the content of native strings must still be translatable to bytes via the Latin-1 encoding! (See the section on Unicode Issues later in this document for more details.)\n\n\nOn python3, `mod_wsgi` use `PyUnicode_AsLatin1String` to translate unicode_based string (str) to bytes internally.","commit_id":"02b3eb869d6c8f490e5aded90f9a55c5f49572fb"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"5984ad2bc93d51609854014bc7167b2f3e67a067","unresolved":false,"context_lines":[{"line_number":743,"context_line":"                headers.append((\u0027Content-Type\u0027, \u0027application/json\u0027))"},{"line_number":744,"context_line":"        status \u003d status or (200, \u0027OK\u0027)"},{"line_number":745,"context_line":""},{"line_number":746,"context_line":"    # NOTE(davechen): `mod_wsgi` needs the value in response header to be"},{"line_number":747,"context_line":"    # binary type(str) on python2, and unicode string(str) on python3, or else"},{"line_number":748,"context_line":"    # `mod_wsgi` will fail and keystone will not work as expected."},{"line_number":749,"context_line":"    # keystone needs to check the data type of each header and convert the"}],"source_content_type":"text/x-python","patch_set":8,"id":"fa69d971_699f0860","line":746,"in_reply_to":"fa69d971_e5afad92","updated":"2015-12-30 14:02:27.000000000","message":"I agree that https://www.python.org/dev/peps/pep-3333/#a-note-on-string-types says that headers should be str, so I\u0027d be fine with that as a solution.","commit_id":"02b3eb869d6c8f490e5aded90f9a55c5f49572fb"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"5984ad2bc93d51609854014bc7167b2f3e67a067","unresolved":false,"context_lines":[{"line_number":758,"context_line":"            str_header \u003d []"},{"line_number":759,"context_line":"            for value in header:"},{"line_number":760,"context_line":"                if six.PY2:"},{"line_number":761,"context_line":"                    if not isinstance(value, six.binary_type):"},{"line_number":762,"context_line":"                        str_header.append(six.binary_type(value))"},{"line_number":763,"context_line":"                    else:"},{"line_number":764,"context_line":"                        str_header.append(value)"}],"source_content_type":"text/x-python","patch_set":8,"id":"fa69d971_49bb24c5","line":761,"updated":"2015-12-30 14:02:27.000000000","message":"since wsgi requires str, it\u0027s confusing to use six here, just use str.","commit_id":"02b3eb869d6c8f490e5aded90f9a55c5f49572fb"},{"author":{"_account_id":13063,"name":"WEI CHEN","email":"dave.jungler@gmail.com","username":"wei.d.chen"},"change_message_id":"6cf41186ee92eab6486c05d103090a3ceb15caad","unresolved":false,"context_lines":[{"line_number":758,"context_line":"            str_header \u003d []"},{"line_number":759,"context_line":"            for value in header:"},{"line_number":760,"context_line":"                if six.PY2:"},{"line_number":761,"context_line":"                    if not isinstance(value, six.binary_type):"},{"line_number":762,"context_line":"                        str_header.append(six.binary_type(value))"},{"line_number":763,"context_line":"                    else:"},{"line_number":764,"context_line":"                        str_header.append(value)"}],"source_content_type":"text/x-python","patch_set":8,"id":"fa69d971_77091395","line":761,"in_reply_to":"fa69d971_49bb24c5","updated":"2015-12-31 03:08:34.000000000","message":"Done","commit_id":"02b3eb869d6c8f490e5aded90f9a55c5f49572fb"},{"author":{"_account_id":2903,"name":"Morgan Fainberg","email":"morgan.fainberg@gmail.com","username":"mdrnstm"},"change_message_id":"dade532de50d2df352cb3cfbadd9a7d464f0bdcc","unresolved":false,"context_lines":[{"line_number":764,"context_line":"                        str_header.append(value)"},{"line_number":765,"context_line":"                else:"},{"line_number":766,"context_line":"                    if not isinstance(value, six.text_type):"},{"line_number":767,"context_line":"                        str_header.append(six.text_type(value))"},{"line_number":768,"context_line":"                    else:"},{"line_number":769,"context_line":"                        str_header.append(value)"},{"line_number":770,"context_line":"            str_headers.append(tuple(str_header))"}],"source_content_type":"text/x-python","patch_set":8,"id":"1a7b0d38_88d0af20","line":767,"updated":"2015-12-28 20:08:00.000000000","message":"This logic is backwards? This should iirc always be binary_type not text_type.","commit_id":"02b3eb869d6c8f490e5aded90f9a55c5f49572fb"},{"author":{"_account_id":17123,"name":"Tom Cocozzello (tjcocozz)","email":"tjcocozz@us.ibm.com","username":"tcocozzello"},"change_message_id":"70c3c83abb9caf0497e1ac7f4aa65a85b6e46732","unresolved":false,"context_lines":[{"line_number":767,"context_line":"                        str_header.append(six.text_type(value))"},{"line_number":768,"context_line":"                    else:"},{"line_number":769,"context_line":"                        str_header.append(value)"},{"line_number":770,"context_line":"            str_headers.append(tuple(str_header))"},{"line_number":771,"context_line":"        return str_headers"},{"line_number":772,"context_line":""},{"line_number":773,"context_line":"    headers \u003d _convert_to_str(headers)"}],"source_content_type":"text/x-python","patch_set":8,"id":"1a7b0d38_45f07291","line":770,"range":{"start_line":770,"start_character":31,"end_line":770,"end_character":48},"updated":"2015-12-28 19:36:16.000000000","message":"I think a comment about why this is being converted to a tuple would be helpful.","commit_id":"02b3eb869d6c8f490e5aded90f9a55c5f49572fb"},{"author":{"_account_id":13063,"name":"WEI CHEN","email":"dave.jungler@gmail.com","username":"wei.d.chen"},"change_message_id":"6cf41186ee92eab6486c05d103090a3ceb15caad","unresolved":false,"context_lines":[{"line_number":767,"context_line":"                        str_header.append(six.text_type(value))"},{"line_number":768,"context_line":"                    else:"},{"line_number":769,"context_line":"                        str_header.append(value)"},{"line_number":770,"context_line":"            str_headers.append(tuple(str_header))"},{"line_number":771,"context_line":"        return str_headers"},{"line_number":772,"context_line":""},{"line_number":773,"context_line":"    headers \u003d _convert_to_str(headers)"}],"source_content_type":"text/x-python","patch_set":8,"id":"fa69d971_57040f7d","line":770,"range":{"start_line":770,"start_character":31,"end_line":770,"end_character":48},"in_reply_to":"1a7b0d38_45f07291","updated":"2015-12-31 03:08:34.000000000","message":"Done","commit_id":"02b3eb869d6c8f490e5aded90f9a55c5f49572fb"},{"author":{"_account_id":13063,"name":"WEI CHEN","email":"dave.jungler@gmail.com","username":"wei.d.chen"},"change_message_id":"b7f25be7a2c3c3450e71ad8cc5c847a112a3764b","unresolved":false,"context_lines":[{"line_number":767,"context_line":"                        str_header.append(six.text_type(value))"},{"line_number":768,"context_line":"                    else:"},{"line_number":769,"context_line":"                        str_header.append(value)"},{"line_number":770,"context_line":"            str_headers.append(tuple(str_header))"},{"line_number":771,"context_line":"        return str_headers"},{"line_number":772,"context_line":""},{"line_number":773,"context_line":"    headers \u003d _convert_to_str(headers)"}],"source_content_type":"text/x-python","patch_set":8,"id":"1a7b0d38_541edebb","line":770,"range":{"start_line":770,"start_character":31,"end_line":770,"end_character":48},"in_reply_to":"1a7b0d38_45f07291","updated":"2015-12-29 02:56:32.000000000","message":"header is key/value pairs and is save in the tuple, but tuple is immutable we cannot change the value in tuple, this is why we need the translation.","commit_id":"02b3eb869d6c8f490e5aded90f9a55c5f49572fb"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"9ceb7a8ff873f6bd6f00c2075a84bc2c10e8485a","unresolved":false,"context_lines":[{"line_number":743,"context_line":"                headers.append((\u0027Content-Type\u0027, \u0027application/json\u0027))"},{"line_number":744,"context_line":"        status \u003d status or (200, \u0027OK\u0027)"},{"line_number":745,"context_line":""},{"line_number":746,"context_line":"    # NOTE(davechen): `mod_wsgi` follows the standards from pep-3333 and"},{"line_number":747,"context_line":"    # requires the value in response header to be binary type(str) on python2,"},{"line_number":748,"context_line":"    # unicode based string(str) on python3, or else keystone will not work"},{"line_number":749,"context_line":"    # under apache with `mod_wsgi`."}],"source_content_type":"text/x-python","patch_set":9,"id":"fa69d971_257a7325","line":746,"updated":"2015-12-31 14:33:21.000000000","message":"No need to mention mod_wsgi. We need to follow the standard.","commit_id":"5b445469b6369fe991f725b90833c54f399ab350"},{"author":{"_account_id":13063,"name":"WEI CHEN","email":"dave.jungler@gmail.com","username":"wei.d.chen"},"change_message_id":"c4336ca7233736c915efef5e64f87f3a0c0962cf","unresolved":false,"context_lines":[{"line_number":743,"context_line":"                headers.append((\u0027Content-Type\u0027, \u0027application/json\u0027))"},{"line_number":744,"context_line":"        status \u003d status or (200, \u0027OK\u0027)"},{"line_number":745,"context_line":""},{"line_number":746,"context_line":"    # NOTE(davechen): `mod_wsgi` follows the standards from pep-3333 and"},{"line_number":747,"context_line":"    # requires the value in response header to be binary type(str) on python2,"},{"line_number":748,"context_line":"    # unicode based string(str) on python3, or else keystone will not work"},{"line_number":749,"context_line":"    # under apache with `mod_wsgi`."}],"source_content_type":"text/x-python","patch_set":9,"id":"fa69d971_6fdcbe12","line":746,"in_reply_to":"fa69d971_257a7325","updated":"2016-01-02 02:09:50.000000000","message":"agreed, so I mentioned the standard here and provide the link, keep `mod_wsgi` here since the issue is raised from mod_wsgi.","commit_id":"5b445469b6369fe991f725b90833c54f399ab350"},{"author":{"_account_id":6482,"name":"Steve Martinelli","email":"s.martinelli@gmail.com","username":"stevemar"},"change_message_id":"443f243a2b1789508a38d9473f1661e5a6722169","unresolved":false,"context_lines":[{"line_number":754,"context_line":"    # see pep-3333:"},{"line_number":755,"context_line":"    # https://www.python.org/dev/peps/pep-3333/#a-note-on-string-types"},{"line_number":756,"context_line":"    # see source from mod_wsgi:"},{"line_number":757,"context_line":"    # https://github.com/GrahamDumpleton/mod_wsgi(methods:"},{"line_number":758,"context_line":"    # wsgi_convert_headers_to_bytes(...), wsgi_convert_string_to_bytes(...)"},{"line_number":759,"context_line":"    # and wsgi_validate_header_value(...))."},{"line_number":760,"context_line":"    def _convert_to_str(headers):"}],"source_content_type":"text/x-python","patch_set":9,"id":"fa69d971_3a3fa688","line":757,"range":{"start_line":757,"start_character":6,"end_line":757,"end_character":50},"updated":"2016-01-05 03:48:05.000000000","message":"add a space between the URL and the bracket (","commit_id":"5b445469b6369fe991f725b90833c54f399ab350"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"9ceb7a8ff873f6bd6f00c2075a84bc2c10e8485a","unresolved":false,"context_lines":[{"line_number":771,"context_line":"            str_headers.append(tuple(str_header))"},{"line_number":772,"context_line":"        return str_headers"},{"line_number":773,"context_line":""},{"line_number":774,"context_line":"    headers \u003d _convert_to_str(headers)"},{"line_number":775,"context_line":""},{"line_number":776,"context_line":"    resp \u003d webob.Response(body\u003dbody,"},{"line_number":777,"context_line":"                          status\u003d\u0027%s %s\u0027 % status,"}],"source_content_type":"text/x-python","patch_set":9,"id":"fa69d971_a5098397","line":774,"updated":"2015-12-31 14:33:21.000000000","message":"This should be moved up to line 727 where this function is already dealing with headers.","commit_id":"5b445469b6369fe991f725b90833c54f399ab350"},{"author":{"_account_id":13063,"name":"WEI CHEN","email":"dave.jungler@gmail.com","username":"wei.d.chen"},"change_message_id":"c4336ca7233736c915efef5e64f87f3a0c0962cf","unresolved":false,"context_lines":[{"line_number":771,"context_line":"            str_headers.append(tuple(str_header))"},{"line_number":772,"context_line":"        return str_headers"},{"line_number":773,"context_line":""},{"line_number":774,"context_line":"    headers \u003d _convert_to_str(headers)"},{"line_number":775,"context_line":""},{"line_number":776,"context_line":"    resp \u003d webob.Response(body\u003dbody,"},{"line_number":777,"context_line":"                          status\u003d\u0027%s %s\u0027 % status,"}],"source_content_type":"text/x-python","patch_set":9,"id":"fa69d971_afd2b6fe","line":774,"in_reply_to":"fa69d971_a5098397","updated":"2016-01-02 02:09:50.000000000","message":"emm, I did this intentionally since here is where headers will be actually passed out. And headers still be modified between L727 and here.","commit_id":"5b445469b6369fe991f725b90833c54f399ab350"}],"keystone/tests/unit/test_wsgi.py":[{"author":{"_account_id":13063,"name":"WEI CHEN","email":"dave.jungler@gmail.com","username":"wei.d.chen"},"change_message_id":"2c2d7cb67985215053d5254665359759f3674cf8","unresolved":false,"context_lines":[{"line_number":448,"context_line":"        server.start()"},{"line_number":449,"context_line":"        self.addCleanup(server.stop)"},{"line_number":450,"context_line":""},{"line_number":451,"context_line":"        if hasattr(socket, \u0027TCP_KEEPIDLE\u0027):"},{"line_number":452,"context_line":"            self.assertEqual(2, mock_sock_dup.setsockopt.call_count)"},{"line_number":453,"context_line":"            # Test the last set of call args i.e. for the keepidle"},{"line_number":454,"context_line":"            mock_sock_dup.setsockopt.assert_called_with(socket.IPPROTO_TCP,"}],"source_content_type":"text/x-python","patch_set":5,"id":"1a7b0d38_e1baeebf","side":"PARENT","line":451,"range":{"start_line":451,"start_character":28,"end_line":451,"end_character":40},"updated":"2015-12-25 09:11:02.000000000","message":"damn!","commit_id":"a422291b03eb73d6c5d4c9207f2ff2de45b6d3ec"}],"keystone/token/providers/fernet/token_formatters.py":[{"author":{"_account_id":13478,"name":"Boris Bobrov","email":"b.bobrov@sap.com","username":"bbobrov"},"change_message_id":"f62efd2cf4916754f762d574c7383bbbcfd149d4","unresolved":false,"context_lines":[{"line_number":75,"context_line":"        # NOTE(davechen) mod_wsgi will fail on python27 if the value returned"},{"line_number":76,"context_line":"        # is unicode, so convert it manually from unicode to str to make it"},{"line_number":77,"context_line":"        # work on python27."},{"line_number":78,"context_line":"        # This is also expected to work on python3 since no change will be made"},{"line_number":79,"context_line":"        # if convert a str to str."},{"line_number":80,"context_line":"        return str(self.crypto.encrypt(payload).rstrip(b\u0027\u003d\u0027).decode(\u0027utf-8\u0027))"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"    def unpack(self, token):"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a7b0d38_62913b99","line":79,"range":{"start_line":78,"start_character":10,"end_line":79,"end_character":34},"updated":"2015-12-24 07:24:28.000000000","message":"Lets wait for Jenkins. My prediction is that it will fail, because str() on python3 is the same as unicode() on python2. I think that six.binary_type should be used here instead.","commit_id":"8d99af84fc16a3606e59767c6687d779c014e16b"},{"author":{"_account_id":13063,"name":"WEI CHEN","email":"dave.jungler@gmail.com","username":"wei.d.chen"},"change_message_id":"fe825bc5314327e9e707ae26e1ceec361879796b","unresolved":false,"context_lines":[{"line_number":75,"context_line":"        # NOTE(davechen) mod_wsgi will fail on python27 if the value returned"},{"line_number":76,"context_line":"        # is unicode, so convert it manually from unicode to str to make it"},{"line_number":77,"context_line":"        # work on python27."},{"line_number":78,"context_line":"        # This is also expected to work on python3 since no change will be made"},{"line_number":79,"context_line":"        # if convert a str to str."},{"line_number":80,"context_line":"        return str(self.crypto.encrypt(payload).rstrip(b\u0027\u003d\u0027).decode(\u0027utf-8\u0027))"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"    def unpack(self, token):"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a7b0d38_22d4931e","line":79,"range":{"start_line":78,"start_character":10,"end_line":79,"end_character":34},"in_reply_to":"1a7b0d38_62913b99","updated":"2015-12-24 07:34:02.000000000","message":"this change will make it always return str regardless it\u0027s on python3 or python2. and what we need is not return unicode on python2.\n\nsix.binary_type will made it return byte on python3, but actually, decode(\u0027utf-8\u0027) should return str on python3 and unicode on python2.\n\nonly encode will return byte.","commit_id":"8d99af84fc16a3606e59767c6687d779c014e16b"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"b9c2ea5ce4b83d8b0ff4d4f01c8c537556267dfb","unresolved":false,"context_lines":[{"line_number":68,"context_line":"        \"\"\"Pack a payload for transport as a token."},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"        :type payload: six.binary_type"},{"line_number":71,"context_line":"        :rtype: six.text_type"},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"        \"\"\""},{"line_number":74,"context_line":"        # base64 padding (if any) is not URL-safe"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a7b0d38_b4574f01","line":71,"updated":"2015-12-24 15:41:11.000000000","message":"the return type is now str not six.text_type.","commit_id":"2000dcd0a96a1ab5e4fc3247960a0876d7ed8d68"},{"author":{"_account_id":19779,"name":"Chason Chan","display_name":"chenxing","email":"chason.chan@foxmail.com","username":"chenxing"},"change_message_id":"af1860aee39ccafa074471b6ba77ead7eeb083cf","unresolved":false,"context_lines":[{"line_number":73,"context_line":"        \"\"\""},{"line_number":74,"context_line":"        # base64 padding (if any) is not URL-safe"},{"line_number":75,"context_line":"        # NOTE(davechen) mod_wsgi will fail on python27 if the value returned"},{"line_number":76,"context_line":"        # is unicode, so convert it manually from unicode to str to make it"},{"line_number":77,"context_line":"        # work on python27."},{"line_number":78,"context_line":"        # This is also expected to work on python3 since no change will be made"},{"line_number":79,"context_line":"        # if convert a str to str."}],"source_content_type":"text/x-python","patch_set":2,"id":"1a7b0d38_40751796","line":76,"range":{"start_line":76,"start_character":61,"end_line":76,"end_character":64},"updated":"2015-12-24 08:50:32.000000000","message":"\"string\"","commit_id":"2000dcd0a96a1ab5e4fc3247960a0876d7ed8d68"},{"author":{"_account_id":13063,"name":"WEI CHEN","email":"dave.jungler@gmail.com","username":"wei.d.chen"},"change_message_id":"c0fa1488fb463cc3d5ddbbf35cb2eb90e2fd9a1c","unresolved":false,"context_lines":[{"line_number":73,"context_line":"        \"\"\""},{"line_number":74,"context_line":"        # base64 padding (if any) is not URL-safe"},{"line_number":75,"context_line":"        # NOTE(davechen) mod_wsgi will fail on python27 if the value returned"},{"line_number":76,"context_line":"        # is unicode, so convert it manually from unicode to str to make it"},{"line_number":77,"context_line":"        # work on python27."},{"line_number":78,"context_line":"        # This is also expected to work on python3 since no change will be made"},{"line_number":79,"context_line":"        # if convert a str to str."}],"source_content_type":"text/x-python","patch_set":2,"id":"1a7b0d38_00e86fb3","line":76,"range":{"start_line":76,"start_character":61,"end_line":76,"end_character":64},"in_reply_to":"1a7b0d38_40751796","updated":"2015-12-24 08:57:08.000000000","message":"i think you need know that str is a python built in data type.","commit_id":"2000dcd0a96a1ab5e4fc3247960a0876d7ed8d68"},{"author":{"_account_id":19779,"name":"Chason Chan","display_name":"chenxing","email":"chason.chan@foxmail.com","username":"chenxing"},"change_message_id":"af1860aee39ccafa074471b6ba77ead7eeb083cf","unresolved":false,"context_lines":[{"line_number":76,"context_line":"        # is unicode, so convert it manually from unicode to str to make it"},{"line_number":77,"context_line":"        # work on python27."},{"line_number":78,"context_line":"        # This is also expected to work on python3 since no change will be made"},{"line_number":79,"context_line":"        # if convert a str to str."},{"line_number":80,"context_line":"        return str(self.crypto.encrypt(payload).rstrip(b\u0027\u003d\u0027).decode(\u0027utf-8\u0027))"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"    def unpack(self, token):"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a7b0d38_609ff3b4","line":79,"range":{"start_line":79,"start_character":23,"end_line":79,"end_character":26},"updated":"2015-12-24 08:50:32.000000000","message":"ditto.","commit_id":"2000dcd0a96a1ab5e4fc3247960a0876d7ed8d68"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"05ac89d6e440d8cb67464ed678f71a2ceebd49ac","unresolved":false,"context_lines":[{"line_number":77,"context_line":"        # work on python27."},{"line_number":78,"context_line":"        # This is also expected to work on python3 since no change will be made"},{"line_number":79,"context_line":"        # if convert a str to str."},{"line_number":80,"context_line":"        return str(self.crypto.encrypt(payload).rstrip(b\u0027\u003d\u0027).decode(\u0027utf-8\u0027))"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"    def unpack(self, token):"},{"line_number":83,"context_line":"        \"\"\"Unpack a token, and validate the payload."}],"source_content_type":"text/x-python","patch_set":2,"id":"1a7b0d38_d4f69bf8","line":80,"updated":"2015-12-24 15:44:48.000000000","message":"why not using six.binary_type()? We don\u0027t have python3 working but I\u0027d think mod_wsgi on python3 would have the same issue with unicode strings.","commit_id":"2000dcd0a96a1ab5e4fc3247960a0876d7ed8d68"},{"author":{"_account_id":13063,"name":"WEI CHEN","email":"dave.jungler@gmail.com","username":"wei.d.chen"},"change_message_id":"12f0036f71d11669b16f76db1ee2df80cf339f4d","unresolved":false,"context_lines":[{"line_number":77,"context_line":"        # work on python27."},{"line_number":78,"context_line":"        # This is also expected to work on python3 since no change will be made"},{"line_number":79,"context_line":"        # if convert a str to str."},{"line_number":80,"context_line":"        return str(self.crypto.encrypt(payload).rstrip(b\u0027\u003d\u0027).decode(\u0027utf-8\u0027))"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"    def unpack(self, token):"},{"line_number":83,"context_line":"        \"\"\"Unpack a token, and validate the payload."}],"source_content_type":"text/x-python","patch_set":2,"id":"1a7b0d38_6affbb67","line":80,"in_reply_to":"1a7b0d38_2ad3f305","updated":"2015-12-25 02:21:46.000000000","message":"but morgan bring a good info, i am going to update this to six.binary_type() in the next PS.\n\nand see if there any better place as brant mentioned can accommodate this change.","commit_id":"2000dcd0a96a1ab5e4fc3247960a0876d7ed8d68"},{"author":{"_account_id":13063,"name":"WEI CHEN","email":"dave.jungler@gmail.com","username":"wei.d.chen"},"change_message_id":"2ba7ace8980c0a6c18a9903bc334a4766ffd9144","unresolved":false,"context_lines":[{"line_number":77,"context_line":"        # work on python27."},{"line_number":78,"context_line":"        # This is also expected to work on python3 since no change will be made"},{"line_number":79,"context_line":"        # if convert a str to str."},{"line_number":80,"context_line":"        return str(self.crypto.encrypt(payload).rstrip(b\u0027\u003d\u0027).decode(\u0027utf-8\u0027))"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"    def unpack(self, token):"},{"line_number":83,"context_line":"        \"\"\"Unpack a token, and validate the payload."}],"source_content_type":"text/x-python","patch_set":2,"id":"1a7b0d38_2ad3f305","line":80,"in_reply_to":"1a7b0d38_c8127c09","updated":"2015-12-25 02:18:31.000000000","message":"I am not using six.binary_type() just because I don\u0027t want to change the behavior of decode on python3.\n\non python3:\n\nencode/unpack will return a byte\ndecode/pack will return a str\n\nIf we using six.binary_type():\n\nencode/unpack will return a byte\ndecode/pack will also return a byte.\n\nI am not quite sure whether this will cause some regression if keystone could run on python3 in the future.","commit_id":"2000dcd0a96a1ab5e4fc3247960a0876d7ed8d68"},{"author":{"_account_id":2903,"name":"Morgan Fainberg","email":"morgan.fainberg@gmail.com","username":"mdrnstm"},"change_message_id":"0e1e72cc8fa4ffcb4ec0073cdb651f983b43b7af","unresolved":false,"context_lines":[{"line_number":77,"context_line":"        # work on python27."},{"line_number":78,"context_line":"        # This is also expected to work on python3 since no change will be made"},{"line_number":79,"context_line":"        # if convert a str to str."},{"line_number":80,"context_line":"        return str(self.crypto.encrypt(payload).rstrip(b\u0027\u003d\u0027).decode(\u0027utf-8\u0027))"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"    def unpack(self, token):"},{"line_number":83,"context_line":"        \"\"\"Unpack a token, and validate the payload."}],"source_content_type":"text/x-python","patch_set":2,"id":"1a7b0d38_c8127c09","line":80,"in_reply_to":"1a7b0d38_d4f69bf8","updated":"2015-12-24 19:09:31.000000000","message":"yea, mod_wsgi gets cranky with unicode types even under py3, this is because mod_wsgi needs byte_str type internally.","commit_id":"2000dcd0a96a1ab5e4fc3247960a0876d7ed8d68"}]}
