)]}'
{"swiftclient/multithreading.py":[{"author":{"_account_id":6968,"name":"Christian Schwede","email":"cschwede@nvidia.com","username":"cschwede"},"change_message_id":"e71fbbfa31d39045e80bd84f946671fcf427f415","unresolved":false,"context_lines":[{"line_number":89,"context_line":"                    l \u003d l.encode(\u0027utf-8\u0027)"},{"line_number":90,"context_line":"                    lines[i] \u003d l"},{"line_number":91,"context_line":"            _msg \u003d \u0027\\n\u0027.join(lines)"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"        self.print_msg(_msg)"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"    def error(self, msg, *fmt_args):"}],"source_content_type":"text/x-python","patch_set":2,"id":"da86d52c_39f91bc9","line":92,"updated":"2015-02-02 08:16:53.000000000","message":"Is it only the join() that fails? Or can it happen in print_msg itself too?","commit_id":"a51b04fb89d4399704203c0472a421266ab78a2e"},{"author":{"_account_id":12193,"name":"Hisashi Osanai","email":"osanai.hisashi@jp.fujitsu.com","username":"ho"},"change_message_id":"ac8839e903d88d8349cf7cc343c34850073ed667","unresolved":false,"context_lines":[{"line_number":89,"context_line":"                    l \u003d l.encode(\u0027utf-8\u0027)"},{"line_number":90,"context_line":"                    lines[i] \u003d l"},{"line_number":91,"context_line":"            _msg \u003d \u0027\\n\u0027.join(lines)"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"        self.print_msg(_msg)"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"    def error(self, msg, *fmt_args):"}],"source_content_type":"text/x-python","patch_set":2,"id":"da86d52c_54e824b4","line":92,"in_reply_to":"da86d52c_073f8926","updated":"2015-02-03 05:56:39.000000000","message":"@Joel, thanks for the explanation. I prefer to have the above code instead of the original one because of the following.\n(1) If python 2.* will be end of support, we need to remove the related code like this. In this case the above code is easy to remove it.\n(2) If there is an unicode in a line with python 2.*,  the above logic is efficient than the original one.\nWhat do you think?","commit_id":"a51b04fb89d4399704203c0472a421266ab78a2e"},{"author":{"_account_id":9216,"name":"Joel Wright","email":"joel.wright@gmail.com","username":"jjw-sohonet"},"change_message_id":"99465dc75db02459535e971ab4dbeca2c68d2db1","unresolved":false,"context_lines":[{"line_number":89,"context_line":"                    l \u003d l.encode(\u0027utf-8\u0027)"},{"line_number":90,"context_line":"                    lines[i] \u003d l"},{"line_number":91,"context_line":"            _msg \u003d \u0027\\n\u0027.join(lines)"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"        self.print_msg(_msg)"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"    def error(self, msg, *fmt_args):"}],"source_content_type":"text/x-python","patch_set":2,"id":"da86d52c_d4944639","line":92,"in_reply_to":"da86d52c_39f91bc9","updated":"2015-02-02 08:43:07.000000000","message":"It\u0027s always the join that fails. The call to print is happy, and correctly sends the output to the terminal.","commit_id":"a51b04fb89d4399704203c0472a421266ab78a2e"},{"author":{"_account_id":12193,"name":"Hisashi Osanai","email":"osanai.hisashi@jp.fujitsu.com","username":"ho"},"change_message_id":"c7e124280ba719efb4cd25977d9e3d76db28a376","unresolved":false,"context_lines":[{"line_number":89,"context_line":"                    l \u003d l.encode(\u0027utf-8\u0027)"},{"line_number":90,"context_line":"                    lines[i] \u003d l"},{"line_number":91,"context_line":"            _msg \u003d \u0027\\n\u0027.join(lines)"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"        self.print_msg(_msg)"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"    def error(self, msg, *fmt_args):"}],"source_content_type":"text/x-python","patch_set":2,"id":"da86d52c_3cb712da","line":92,"in_reply_to":"da86d52c_54e824b4","updated":"2015-02-03 09:09:37.000000000","message":"@Joel, One correction\ns/the above code/the above code which you wrote in your comment at Feb 2 8:36 PM/","commit_id":"a51b04fb89d4399704203c0472a421266ab78a2e"},{"author":{"_account_id":9216,"name":"Joel Wright","email":"joel.wright@gmail.com","username":"jjw-sohonet"},"change_message_id":"f53446c4bb03ee11778e089d6224716249de0307","unresolved":false,"context_lines":[{"line_number":89,"context_line":"                    l \u003d l.encode(\u0027utf-8\u0027)"},{"line_number":90,"context_line":"                    lines[i] \u003d l"},{"line_number":91,"context_line":"            _msg \u003d \u0027\\n\u0027.join(lines)"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"        self.print_msg(_msg)"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"    def error(self, msg, *fmt_args):"}],"source_content_type":"text/x-python","patch_set":2,"id":"da86d52c_073f8926","line":92,"in_reply_to":"da86d52c_a4c15be6","updated":"2015-02-02 11:36:12.000000000","message":"I don\u0027t think this code will work. The problem I see is not caused by the filename being unicode that needs to be encoded to bytes, but rather by one of the other lines being unicode.\n\nIf one of the strings in the list is unicode (In my case the Account:... line), then python2 tries to convert everything into unicode. Unfortunately at this point, by object name is already a string of bytes and not valid unicode so the encode fails.\n\nthe following code would be another option:\n\n    if six.PY2:\n        for i, l in enumerate(lines):\n            if isinstance(l, unicode):\n                lines[i] \u003d l.encode(\u0027utf-8\u0027)\n    self.print_msg(\u0027\\n\u0027.join(lines))","commit_id":"a51b04fb89d4399704203c0472a421266ab78a2e"},{"author":{"_account_id":12193,"name":"Hisashi Osanai","email":"osanai.hisashi@jp.fujitsu.com","username":"ho"},"change_message_id":"cf82a569d7a28d7391fd269b001d2bb6b1658691","unresolved":false,"context_lines":[{"line_number":89,"context_line":"                    l \u003d l.encode(\u0027utf-8\u0027)"},{"line_number":90,"context_line":"                    lines[i] \u003d l"},{"line_number":91,"context_line":"            _msg \u003d \u0027\\n\u0027.join(lines)"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"        self.print_msg(_msg)"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"    def error(self, msg, *fmt_args):"}],"source_content_type":"text/x-python","patch_set":2,"id":"da86d52c_a4c15be6","line":92,"in_reply_to":"da86d52c_d4944639","updated":"2015-02-02 11:08:00.000000000","message":"The above logic looks a bit complicated. The following logic doesn\u0027t check whether lines have non-ascii or not but looks simple. What do you think?\n\nif six.PY2:\n    lines \u003d [l.encode(\u0027utf-8\u0027) for l in lines]\nself.print_msg(\u0027\\n\u0027.join(lines))","commit_id":"a51b04fb89d4399704203c0472a421266ab78a2e"},{"author":{"_account_id":597,"name":"Pete Zaitcev","email":"zaitcev@kotori.zaitcev.us","username":"zaitcev"},"change_message_id":"5f22c815bd00c44926cae62eade575ba9c81b2cf","unresolved":false,"context_lines":[{"line_number":90,"context_line":"            if skip_missing and not v:"},{"line_number":91,"context_line":"                continue"},{"line_number":92,"context_line":"            lines.append((template % (k, v)).rstrip())"},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"        if six.PY2:"},{"line_number":95,"context_line":"            for i, l in enumerate(lines):"},{"line_number":96,"context_line":"                if isinstance(l, unicode):"}],"source_content_type":"text/x-python","patch_set":4,"id":"da86d52c_d2592836","line":93,"updated":"2015-02-11 20:41:52.000000000","message":"Sorry, but I disagree with this approach. It\u0027s wrong because it ends doing double-encode. The print_msg is supposed to take everything without the usual Unicode crash. There\u0027s even a comment to that effect, which this patch neglected to adjust. Heck, one look at _print() tells you how wrong this is.\n\nThe real problem is the join(), or, in other words, careless handling of the material that print_items() receives. So, don\u0027t join!\n\nA number of better approaches that avoids nested string-safing could exist. Call print_msg several times, or adjust print_msg to look at list with isinstance(list), or create a whole new write_msg() that passes a list, with print_msg() being one.","commit_id":"fd4c8012a1bff32797f74a0c7aec1ac893061986"}]}
