)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"e122473fd540f84fdd3d8e97a1c4f6c9f477baa2","unresolved":false,"context_lines":[{"line_number":9,"context_line":"Issues:"},{"line_number":10,"context_line":"- Method `webob.multidict.MultiDict.items` returns list object in py2 env[1]"},{"line_number":11,"context_line":"  and listiterator in  py3 env[2]. ListIterator prevents to unablility to"},{"line_number":12,"context_line":"  change values of headers in a loop(changes of item\u0027s order prevent to skip"},{"line_number":13,"context_line":"  some headers)."},{"line_number":14,"context_line":"- Statement `nova.utils.utf8(str(some_value))` did not work for bytes type in"},{"line_number":15,"context_line":"  py3 env. Good example is `test_resource_headers_are_utf8` test. Int value 1"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"7a2fa921_3de841e2","line":12,"updated":"2015-10-06 15:33:50.000000000","message":"femtonits:\n\ns/prevents to unablility to change values/prevents changing the values/\n\ns/prevent to skip/prevents skipping/","commit_id":"77b4f318432beab42dab47ce440de7f6b234268b"},{"author":{"_account_id":9545,"name":"Andriy Kurilin","email":"andr.kurilin@gmail.com","username":"akurilin"},"change_message_id":"a5a39b25ad31d1ec1987f6690c97d24cba478639","unresolved":false,"context_lines":[{"line_number":9,"context_line":"Issues:"},{"line_number":10,"context_line":"- Method `webob.multidict.MultiDict.items` returns list object in py2 env[1]"},{"line_number":11,"context_line":"  and listiterator in  py3 env[2]. ListIterator prevents to unablility to"},{"line_number":12,"context_line":"  change values of headers in a loop(changes of item\u0027s order prevent to skip"},{"line_number":13,"context_line":"  some headers)."},{"line_number":14,"context_line":"- Statement `nova.utils.utf8(str(some_value))` did not work for bytes type in"},{"line_number":15,"context_line":"  py3 env. Good example is `test_resource_headers_are_utf8` test. Int value 1"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"da85f559_c85c264d","line":12,"in_reply_to":"7a2fa921_3de841e2","updated":"2015-11-12 14:39:48.000000000","message":"Done","commit_id":"77b4f318432beab42dab47ce440de7f6b234268b"}],"nova/tests/unit/api/openstack/test_wsgi.py":[{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"b115bbf135e6a17e2313aef4f97a50e99925333e","unresolved":false,"context_lines":[{"line_number":1150,"context_line":"                    try:"},{"line_number":1151,"context_line":"                        hdr.decode(\"utf-8\")"},{"line_number":1152,"context_line":"                    except UnicodeDecodeError:"},{"line_number":1153,"context_line":"                        self.fail(\"Header \u0027%s\u0027 is not in unf-8\" % hdr)"},{"line_number":1154,"context_line":"                if not isinstance(val, (six.binary_type, six.text_type)):"},{"line_number":1155,"context_line":"                    try:"},{"line_number":1156,"context_line":"                        val.decode(\"utf-8\")"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a2fa921_cb13b50c","line":1153,"updated":"2015-10-05 16:23:32.000000000","message":"\"unf-8\"?  Did you mean \"utf-8\"?  :)","commit_id":"4412e06053100545d1d9a82c3d2b54f32c855085"},{"author":{"_account_id":9545,"name":"Andriy Kurilin","email":"andr.kurilin@gmail.com","username":"akurilin"},"change_message_id":"cca4330032964d4859d0444ca4c698b2798c19bd","unresolved":false,"context_lines":[{"line_number":1150,"context_line":"                    try:"},{"line_number":1151,"context_line":"                        hdr.decode(\"utf-8\")"},{"line_number":1152,"context_line":"                    except UnicodeDecodeError:"},{"line_number":1153,"context_line":"                        self.fail(\"Header \u0027%s\u0027 is not in unf-8\" % hdr)"},{"line_number":1154,"context_line":"                if not isinstance(val, (six.binary_type, six.text_type)):"},{"line_number":1155,"context_line":"                    try:"},{"line_number":1156,"context_line":"                        val.decode(\"utf-8\")"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a2fa921_137ec3e4","line":1153,"in_reply_to":"7a2fa921_cb13b50c","updated":"2015-10-05 20:45:33.000000000","message":"yep...","commit_id":"4412e06053100545d1d9a82c3d2b54f32c855085"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"d5b60c0dfefca40033cc804406cc7b22d03f0409","unresolved":false,"context_lines":[{"line_number":27,"context_line":"from oslo_serialization import jsonutils"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"def _check_obj_encoded_by_utf8(obj):"},{"line_number":31,"context_line":"    if isinstance(obj, (six.binary_type, six.text_type)):"},{"line_number":32,"context_line":"        if hasattr(obj, \"decode\"):"},{"line_number":33,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":4,"id":"da85f559_8c7aa822","line":30,"updated":"2015-11-12 17:02:02.000000000","message":"I\u0027m not certain that this is the correct implementation.  I think my greatest discomfort is with the use of six.text_type.  I interpret the purpose of this method to be to determine if obj is a binary object with UTF-8 encoding or not, just based on the name—so it shouldn\u0027t accept six.text_type, which corresponds to unicode in Python 2 and str in Python 3.  I think you should drop the six.text_type altogether.  To explain why, consider the following test in Python 2:\n\n    \u003e\u003e\u003e _check_obj_encoded_by_utf8(u\u0027test\\u2026config\u0027)\n    Traceback (most recent call last):\n      File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\n      File \"\u003cstdin\u003e\", line 5, in _check_obj_encoded_by_utf8\n      File \"/usr/lib64/python2.7/encodings/utf_8.py\", line 16, in decode\n        return codecs.utf_8_decode(input, errors, True)\n    UnicodeEncodeError: \u0027ascii\u0027 codec can\u0027t encode character u\u0027\\u2026\u0027 in position 4: ordinal not in range(128)\n\nCompared to the same thing in Python 3:\n\n    \u003e\u003e\u003e _check_obj_encoded_by_utf8(u\u0027test\\u2026config\u0027)\n    True\n\nIt\u0027s obvious that the result is incorrect in both cases.\n\nAlso, as an alternative implementation, you may want to consider implementing this as a matcher (see nova/tests/unit/matchers.py) that you would then use with self.assertThat(); that could then make this available to the rest of the Nova test suite, and you could then avoid the use of the message argument to self.assertTrue().\n\n(Note that self.assertThat() is not part of unittest; it is an extension provided by testtools, which is where our test classes are derived from.)","commit_id":"05685a80541ab5cd775bc0e289870dce8bfd6b4a"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"b139acd12361db8da3f8deb48b5d05aa9aea79c2","unresolved":false,"context_lines":[{"line_number":27,"context_line":"from oslo_serialization import jsonutils"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"def _check_obj_encoded_by_utf8(obj):"},{"line_number":31,"context_line":"    if isinstance(obj, (six.binary_type, six.text_type)):"},{"line_number":32,"context_line":"        if hasattr(obj, \"decode\"):"},{"line_number":33,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":4,"id":"7a740942_f6548dca","line":30,"in_reply_to":"da85f559_8c7aa822","updated":"2015-12-08 14:42:35.000000000","message":"Can we answer this comment here please?","commit_id":"05685a80541ab5cd775bc0e289870dce8bfd6b4a"},{"author":{"_account_id":9545,"name":"Andriy Kurilin","email":"andr.kurilin@gmail.com","username":"akurilin"},"change_message_id":"7348efad0a3a443d10ac8b05c4a4a2f8e18482b3","unresolved":false,"context_lines":[{"line_number":27,"context_line":"from oslo_serialization import jsonutils"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"def _check_obj_encoded_by_utf8(obj):"},{"line_number":31,"context_line":"    if isinstance(obj, (six.binary_type, six.text_type)):"},{"line_number":32,"context_line":"        if hasattr(obj, \"decode\"):"},{"line_number":33,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":4,"id":"7a740942_40718143","line":30,"in_reply_to":"da85f559_8c7aa822","updated":"2015-12-10 19:48:01.000000000","message":"Yes, you are right. Fixed. Btw, thanks for matchers(this mechanism is new for me).","commit_id":"05685a80541ab5cd775bc0e289870dce8bfd6b4a"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"a0980fecf10ac38f7db9e824580f497349340604","unresolved":false,"context_lines":[{"line_number":1007,"context_line":"        req \u003d webob.Request.blank(\u0027/tests\u0027)"},{"line_number":1008,"context_line":"        app \u003d fakes.TestRouter(Controller())"},{"line_number":1009,"context_line":"        response \u003d req.get_response(app)"},{"line_number":1010,"context_line":"        for val in six.itervalues(response.headers):"},{"line_number":1011,"context_line":"            # All headers must be utf8"},{"line_number":1012,"context_line":"            self.assertThat(val, matchers.EncodedByUTF8())"},{"line_number":1013,"context_line":"        self.assertEqual(b\u00271\u0027, response.headers[\u0027x-header1\u0027])"}],"source_content_type":"text/x-python","patch_set":6,"id":"7a740942_93d4a2bd","line":1010,"updated":"2015-12-10 20:36:14.000000000","message":"femtonit: it would probably be worthwhile to switch from six.iter*() to just plain \"response.headers.values()\"…","commit_id":"cc1ff0051a767a5d2e0e525767455ca1c3363c2e"}],"nova/tests/unit/matchers.py":[{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"a0980fecf10ac38f7db9e824580f497349340604","unresolved":false,"context_lines":[{"line_number":539,"context_line":"                    obj.decode(\"utf-8\")"},{"line_number":540,"context_line":"                except UnicodeDecodeError:"},{"line_number":541,"context_line":"                    return testtools.matchers.Mismatch("},{"line_number":542,"context_line":"                        \"%s is not encoded in UTF-8.\" % obj)"},{"line_number":543,"context_line":"        else:"},{"line_number":544,"context_line":"            reason \u003d (\"Type of \u0027%(obj)s\u0027 is \u0027%(obj_type)s\u0027, \""},{"line_number":545,"context_line":"                      \"should be \u0027%(correct_type)s\u0027.\""}],"source_content_type":"text/x-python","patch_set":6,"id":"7a740942_f3f2c699","line":542,"updated":"2015-12-10 20:36:14.000000000","message":"femtonit: I\u0027d like %r on obj rather than %s…","commit_id":"cc1ff0051a767a5d2e0e525767455ca1c3363c2e"}],"nova/tests/unit/test_utils.py":[{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"d5b60c0dfefca40033cc804406cc7b22d03f0409","unresolved":false,"context_lines":[{"line_number":1411,"context_line":""},{"line_number":1412,"context_line":"    def test_text_type_with_encoding(self):"},{"line_number":1413,"context_line":"        # \"hello world!\" in Russian"},{"line_number":1414,"context_line":"        some_value \u003d u\"Привет мир!\""},{"line_number":1415,"context_line":"        self.assertEqual(some_value, utils.utf8(some_value).decode(\"utf-8\"))"}],"source_content_type":"text/x-python","patch_set":4,"id":"da85f559_0f88ea6f","line":1414,"updated":"2015-11-12 17:02:02.000000000","message":"You can eliminate the utf-8 encoding for the file if you use a unicode escape.  For some recent code where I wanted to check proper handling of unicode and utf-8, I used u\u0027test\\u2026config\u0027, corresponding to b\u0027test\\xe2\\x80\\xa6config\u0027.","commit_id":"05685a80541ab5cd775bc0e289870dce8bfd6b4a"},{"author":{"_account_id":9545,"name":"Andriy Kurilin","email":"andr.kurilin@gmail.com","username":"akurilin"},"change_message_id":"7348efad0a3a443d10ac8b05c4a4a2f8e18482b3","unresolved":false,"context_lines":[{"line_number":1411,"context_line":""},{"line_number":1412,"context_line":"    def test_text_type_with_encoding(self):"},{"line_number":1413,"context_line":"        # \"hello world!\" in Russian"},{"line_number":1414,"context_line":"        some_value \u003d u\"Привет мир!\""},{"line_number":1415,"context_line":"        self.assertEqual(some_value, utils.utf8(some_value).decode(\"utf-8\"))"}],"source_content_type":"text/x-python","patch_set":4,"id":"7a740942_ea233954","line":1414,"in_reply_to":"da85f559_0f88ea6f","updated":"2015-12-10 19:48:01.000000000","message":"Done","commit_id":"05685a80541ab5cd775bc0e289870dce8bfd6b4a"}],"nova/utils.py":[{"author":{"_account_id":18247,"name":"Mark Doffman","email":"mdoffman@linux.vnet.ibm.com","username":"doffm"},"change_message_id":"dea3ea2881e15d7c808e84f5305c4ef958563b5b","unresolved":false,"context_lines":[{"line_number":588,"context_line":"    \"\"\"Try to turn a string into utf-8 if possible."},{"line_number":589,"context_line":""},{"line_number":590,"context_line":"    Code is directly from the utf8 function in"},{"line_number":591,"context_line":"    http://github.com/facebook/tornado/blob/master/tornado/escape.py"},{"line_number":592,"context_line":""},{"line_number":593,"context_line":"    \"\"\""},{"line_number":594,"context_line":"    if isinstance(value, (bytes, type(None))):"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a2fa921_4b9c8569","line":591,"updated":"2015-10-05 16:32:39.000000000","message":"This isn\u0027t true any more? The code in this function no longer looks anything like this.","commit_id":"4412e06053100545d1d9a82c3d2b54f32c855085"},{"author":{"_account_id":9545,"name":"Andriy Kurilin","email":"andr.kurilin@gmail.com","username":"akurilin"},"change_message_id":"cca4330032964d4859d0444ca4c698b2798c19bd","unresolved":false,"context_lines":[{"line_number":588,"context_line":"    \"\"\"Try to turn a string into utf-8 if possible."},{"line_number":589,"context_line":""},{"line_number":590,"context_line":"    Code is directly from the utf8 function in"},{"line_number":591,"context_line":"    http://github.com/facebook/tornado/blob/master/tornado/escape.py"},{"line_number":592,"context_line":""},{"line_number":593,"context_line":"    \"\"\""},{"line_number":594,"context_line":"    if isinstance(value, (bytes, type(None))):"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a2fa921_47d54e41","line":591,"in_reply_to":"7a2fa921_4b9c8569","updated":"2015-10-05 20:45:33.000000000","message":"I suppose we should left this link.","commit_id":"4412e06053100545d1d9a82c3d2b54f32c855085"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"b115bbf135e6a17e2313aef4f97a50e99925333e","unresolved":false,"context_lines":[{"line_number":591,"context_line":"    http://github.com/facebook/tornado/blob/master/tornado/escape.py"},{"line_number":592,"context_line":""},{"line_number":593,"context_line":"    \"\"\""},{"line_number":594,"context_line":"    if isinstance(value, (bytes, type(None))):"},{"line_number":595,"context_line":"        return value"},{"line_number":596,"context_line":""},{"line_number":597,"context_line":"    if not isinstance(value, six.text_type):"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a2fa921_0bd8cd52","line":594,"updated":"2015-10-05 16:23:32.000000000","message":"I\u0027d slightly prefer:\n\n    if value is None or isinstance(value, bytes):","commit_id":"4412e06053100545d1d9a82c3d2b54f32c855085"},{"author":{"_account_id":9545,"name":"Andriy Kurilin","email":"andr.kurilin@gmail.com","username":"akurilin"},"change_message_id":"cca4330032964d4859d0444ca4c698b2798c19bd","unresolved":false,"context_lines":[{"line_number":591,"context_line":"    http://github.com/facebook/tornado/blob/master/tornado/escape.py"},{"line_number":592,"context_line":""},{"line_number":593,"context_line":"    \"\"\""},{"line_number":594,"context_line":"    if isinstance(value, (bytes, type(None))):"},{"line_number":595,"context_line":"        return value"},{"line_number":596,"context_line":""},{"line_number":597,"context_line":"    if not isinstance(value, six.text_type):"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a2fa921_a7c46292","line":594,"in_reply_to":"7a2fa921_0bd8cd52","updated":"2015-10-05 20:45:33.000000000","message":"Done","commit_id":"4412e06053100545d1d9a82c3d2b54f32c855085"},{"author":{"_account_id":18247,"name":"Mark Doffman","email":"mdoffman@linux.vnet.ibm.com","username":"doffm"},"change_message_id":"dea3ea2881e15d7c808e84f5305c4ef958563b5b","unresolved":false,"context_lines":[{"line_number":592,"context_line":""},{"line_number":593,"context_line":"    \"\"\""},{"line_number":594,"context_line":"    if isinstance(value, (bytes, type(None))):"},{"line_number":595,"context_line":"        return value"},{"line_number":596,"context_line":""},{"line_number":597,"context_line":"    if not isinstance(value, six.text_type):"},{"line_number":598,"context_line":"        value \u003d six.text_type(value)"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a2fa921_6ba3819f","line":595,"updated":"2015-10-05 16:32:39.000000000","message":"I\u0027d prefer this a lot. isinstance of type(None) was pretty confusing.","commit_id":"4412e06053100545d1d9a82c3d2b54f32c855085"},{"author":{"_account_id":9545,"name":"Andriy Kurilin","email":"andr.kurilin@gmail.com","username":"akurilin"},"change_message_id":"cca4330032964d4859d0444ca4c698b2798c19bd","unresolved":false,"context_lines":[{"line_number":592,"context_line":""},{"line_number":593,"context_line":"    \"\"\""},{"line_number":594,"context_line":"    if isinstance(value, (bytes, type(None))):"},{"line_number":595,"context_line":"        return value"},{"line_number":596,"context_line":""},{"line_number":597,"context_line":"    if not isinstance(value, six.text_type):"},{"line_number":598,"context_line":"        value \u003d six.text_type(value)"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a2fa921_07467623","line":595,"in_reply_to":"7a2fa921_6ba3819f","updated":"2015-10-05 20:45:33.000000000","message":"btw, such check was copy-pasted from updated original method;)","commit_id":"4412e06053100545d1d9a82c3d2b54f32c855085"},{"author":{"_account_id":2750,"name":"Sean Dague","email":"sean@dague.net","username":"sdague"},"change_message_id":"32759b2dc6574e52248776f979f23f416322b1fe","unresolved":false,"context_lines":[{"line_number":597,"context_line":"    if not isinstance(value, six.text_type):"},{"line_number":598,"context_line":"        value \u003d six.text_type(value)"},{"line_number":599,"context_line":""},{"line_number":600,"context_line":"    return value.encode(\u0027utf-8\u0027)"},{"line_number":601,"context_line":""},{"line_number":602,"context_line":""},{"line_number":603,"context_line":"def check_isinstance(obj, cls):"}],"source_content_type":"text/x-python","patch_set":3,"id":"3a29b11f_d1118a05","line":600,"updated":"2015-10-21 13:58:50.000000000","message":"I feel like these changes should have unit tests for them, this is now pretty complicated with a number of branches.","commit_id":"77b4f318432beab42dab47ce440de7f6b234268b"},{"author":{"_account_id":9545,"name":"Andriy Kurilin","email":"andr.kurilin@gmail.com","username":"akurilin"},"change_message_id":"a5a39b25ad31d1ec1987f6690c97d24cba478639","unresolved":false,"context_lines":[{"line_number":597,"context_line":"    if not isinstance(value, six.text_type):"},{"line_number":598,"context_line":"        value \u003d six.text_type(value)"},{"line_number":599,"context_line":""},{"line_number":600,"context_line":"    return value.encode(\u0027utf-8\u0027)"},{"line_number":601,"context_line":""},{"line_number":602,"context_line":""},{"line_number":603,"context_line":"def check_isinstance(obj, cls):"}],"source_content_type":"text/x-python","patch_set":3,"id":"da85f559_6805fa11","line":600,"in_reply_to":"3a29b11f_d1118a05","updated":"2015-11-12 14:39:48.000000000","message":"Done","commit_id":"77b4f318432beab42dab47ce440de7f6b234268b"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"d5b60c0dfefca40033cc804406cc7b22d03f0409","unresolved":false,"context_lines":[{"line_number":591,"context_line":"    http://github.com/facebook/tornado/blob/master/tornado/escape.py"},{"line_number":592,"context_line":""},{"line_number":593,"context_line":"    \"\"\""},{"line_number":594,"context_line":"    if value is None or isinstance(value, bytes):"},{"line_number":595,"context_line":"        return value"},{"line_number":596,"context_line":""},{"line_number":597,"context_line":"    if not isinstance(value, six.text_type):"}],"source_content_type":"text/x-python","patch_set":4,"id":"da85f559_ef6006a7","line":594,"updated":"2015-11-12 17:02:02.000000000","message":"Hmmm…could we use six.binary_type here, just for consistency?  The code ends up being the same either way, so just a thought…","commit_id":"05685a80541ab5cd775bc0e289870dce8bfd6b4a"},{"author":{"_account_id":9545,"name":"Andriy Kurilin","email":"andr.kurilin@gmail.com","username":"akurilin"},"change_message_id":"7348efad0a3a443d10ac8b05c4a4a2f8e18482b3","unresolved":false,"context_lines":[{"line_number":591,"context_line":"    http://github.com/facebook/tornado/blob/master/tornado/escape.py"},{"line_number":592,"context_line":""},{"line_number":593,"context_line":"    \"\"\""},{"line_number":594,"context_line":"    if value is None or isinstance(value, bytes):"},{"line_number":595,"context_line":"        return value"},{"line_number":596,"context_line":""},{"line_number":597,"context_line":"    if not isinstance(value, six.text_type):"}],"source_content_type":"text/x-python","patch_set":4,"id":"7a740942_aa61b1d4","line":594,"in_reply_to":"da85f559_ef6006a7","updated":"2015-12-10 19:48:01.000000000","message":"Done","commit_id":"05685a80541ab5cd775bc0e289870dce8bfd6b4a"}]}
