)]}'
{"swiftclient/shell.py":[{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"9f64b923b57c40e45563f101d958e73fe2a3a163","unresolved":false,"context_lines":[{"line_number":876,"context_line":"                                    if msg:"},{"line_number":877,"context_line":"                                        msg +\u003d \u0027: \u0027"},{"line_number":878,"context_line":"                                    msg +\u003d (error.http_response_content[:60]"},{"line_number":879,"context_line":"                                            .decode(\u0027utf8\u0027))"},{"line_number":880,"context_line":"                                msg \u003d \u0027: %s\u0027 % msg"},{"line_number":881,"context_line":"                        else:"},{"line_number":882,"context_line":"                            msg \u003d \u0027: %s\u0027 % error"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa1b9901_7d1a5d70","line":879,"updated":"2015-08-17 18:33:17.000000000","message":"Is there any chance the response content could have multi-byte characters? I\u0027m vaguely worried that the slice will end part-way through a character like é ( \u0027\\xc3\\xa9\u0027 ), resulting in decode errors. Is there a reason not to decode the whole thing, then slice? Then again, this is an error message, so maybe it should all be us-ascii anyway?","commit_id":"6a40587d6fc86b9689f06e12e420125e2019f373"},{"author":{"_account_id":12050,"name":"Charles Hsu","email":"charles0126@gmail.com","username":"charz"},"change_message_id":"da00bc16748fff43a7546d9d6ac8b6f396fdc25c","unresolved":false,"context_lines":[{"line_number":876,"context_line":"                                    if msg:"},{"line_number":877,"context_line":"                                        msg +\u003d \u0027: \u0027"},{"line_number":878,"context_line":"                                    msg +\u003d (error.http_response_content[:60]"},{"line_number":879,"context_line":"                                            .decode(\u0027utf8\u0027))"},{"line_number":880,"context_line":"                                msg \u003d \u0027: %s\u0027 % msg"},{"line_number":881,"context_line":"                        else:"},{"line_number":882,"context_line":"                            msg \u003d \u0027: %s\u0027 % error"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa1b9901_e7c1dee5","line":879,"in_reply_to":"fa1b9901_7d1a5d70","updated":"2015-08-18 08:17:08.000000000","message":"The \u0027é\u0027 can\u0027t accept in byte string, but \u0027\\xc3\\xa9\u0027 will be accept.  Looks the multi-byte characters (\u0027\\xc3\\xa9\u0027) can be decode with utf8. \n\nI think we can decode whole string not slice it.\n\nYes, that\u0027s a error message. that should all be ascii characters. but If there is some multi-byte characters in the byte string, resulting in decode errors in ascii.","commit_id":"6a40587d6fc86b9689f06e12e420125e2019f373"},{"author":{"_account_id":12050,"name":"Charles Hsu","email":"charles0126@gmail.com","username":"charz"},"change_message_id":"84c6fdb8733ce5e907d0477ee0e4dd395c7638d7","unresolved":false,"context_lines":[{"line_number":876,"context_line":"                                    if msg:"},{"line_number":877,"context_line":"                                        msg +\u003d \u0027: \u0027"},{"line_number":878,"context_line":"                                    msg +\u003d (error.http_response_content[:60]"},{"line_number":879,"context_line":"                                            .decode(\u0027utf8\u0027))"},{"line_number":880,"context_line":"                                msg \u003d \u0027: %s\u0027 % msg"},{"line_number":881,"context_line":"                        else:"},{"line_number":882,"context_line":"                            msg \u003d \u0027: %s\u0027 % error"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa1b9901_be79affe","line":879,"in_reply_to":"fa1b9901_e7c1dee5","updated":"2015-08-18 09:51:29.000000000","message":"If we have concern on decode, maybe this will be good on it.\n\n            msg +\u003d \u0027%s\u0027 % error.http_response_content","commit_id":"6a40587d6fc86b9689f06e12e420125e2019f373"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"9ac1f4a404485bb4ba023e79efdf1e054bbcab2b","unresolved":false,"context_lines":[{"line_number":875,"context_line":"                                if error.http_response_content:"},{"line_number":876,"context_line":"                                    if msg:"},{"line_number":877,"context_line":"                                        msg +\u003d \u0027: \u0027"},{"line_number":878,"context_line":"                                    msg +\u003d \u0027%s\u0027 % error.http_response_content"},{"line_number":879,"context_line":"                                msg \u003d \u0027: %s\u0027 % msg"},{"line_number":880,"context_line":"                        else:"},{"line_number":881,"context_line":"                            msg \u003d \u0027: %s\u0027 % error"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa1b9901_305612d3","line":878,"updated":"2015-08-18 18:34:46.000000000","message":"That doesn\u0027t quite seem to be what we want...\n\n    \u003e\u003e\u003e msg \u003d \u0027foo\u0027\n    \u003e\u003e\u003e msg +\u003d \u0027%s\u0027 % b\u0027bar\u0027\n    \u003e\u003e\u003e msg\n    \"foob\u0027bar\u0027\"\n\nPlus, we no longer truncate the body at all. What about something like this?\n\n    msg +\u003d error.http_response_content.decode(\u0027utf-8\u0027)[:60]\n\nAlthough, it may be better to do the bytes-\u003eunicode conversion as we\u0027re instantiating the error; at that point, we still have all of the response headers, so we know whether utf-8 is even the right encoding. (It is if we\u0027re talking to Swift, but the user could have mistyped the auth or storage url.)","commit_id":"4cb8c48638537d432e93e85e208062f5fa441528"},{"author":{"_account_id":12050,"name":"Charles Hsu","email":"charles0126@gmail.com","username":"charz"},"change_message_id":"764ba23bdb796a25194e596432ec236ec59f0b62","unresolved":false,"context_lines":[{"line_number":875,"context_line":"                                if error.http_response_content:"},{"line_number":876,"context_line":"                                    if msg:"},{"line_number":877,"context_line":"                                        msg +\u003d \u0027: \u0027"},{"line_number":878,"context_line":"                                    msg +\u003d \u0027%s\u0027 % error.http_response_content"},{"line_number":879,"context_line":"                                msg \u003d \u0027: %s\u0027 % msg"},{"line_number":880,"context_line":"                        else:"},{"line_number":881,"context_line":"                            msg \u003d \u0027: %s\u0027 % error"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa1b9901_27d8041d","line":878,"in_reply_to":"fa1b9901_305612d3","updated":"2015-08-19 04:31:02.000000000","message":"Agree, but it seems also happens in ClientException in exceptions.py\n\n    Container POST failed: http://192.168.200.21/v1/AUTH_demo/testing2 403 Forbidden  [first 60 chars of response] b\u0027\u003chtml\u003e\u003ch1\u003eForbidden\u003c/h1\u003e\u003cp\u003eAccess was denied to this resourc\u0027\n\nThis looks better.\n\n    msg +\u003d error.http_response_content.decode(\u0027utf-8\u0027)[:60]\n\nI think that\u0027s a body content in a byte string, so it should be fine to decode it to utf8.","commit_id":"4cb8c48638537d432e93e85e208062f5fa441528"}]}
