)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":11022,"name":"Rodrigo Duarte Sousa","email":"rodrigodsousa@gmail.com","username":"rodrigods"},"change_message_id":"0ab3a44f7887e964210b0688220233de5661d8d1","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Nikita Konovalov \u003cnkonovalov@mirantis.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2015-05-21 16:53:01 +0300"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Fix logging of binray contentent in request"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"The request body may containt binary file which should not be logged."},{"line_number":10,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"7a016987_fbeb30da","line":7,"updated":"2015-05-21 22:04:46.000000000","message":"s/binray/binary","commit_id":"3ba003e284d3bd540fdb1c96796e0aebc9c5f3f8"},{"author":{"_account_id":11022,"name":"Rodrigo Duarte Sousa","email":"rodrigodsousa@gmail.com","username":"rodrigods"},"change_message_id":"c5075dae3997d78b9ff15fb1b318fed65a4c469a","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Nikita Konovalov \u003cnkonovalov@mirantis.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2015-06-01 17:39:50 +0300"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Fix logging of binray contentent in request"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"The request body may containt binary file which should not be logged."},{"line_number":10,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"fa32b979_ffa6aaac","line":7,"updated":"2015-06-18 13:13:28.000000000","message":"binary*","commit_id":"23e102c38171cbf622488ad4324001cd7a058a1f"},{"author":{"_account_id":11022,"name":"Rodrigo Duarte Sousa","email":"rodrigodsousa@gmail.com","username":"rodrigods"},"change_message_id":"516baa3fe05b5335d894e9592900340739873c48","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Nikita Konovalov \u003cnkonovalov@mirantis.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2015-08-18 18:31:40 +0300"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Fix logging of binray contentent in request"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"The request body may containt binary file which will lead"},{"line_number":10,"context_line":"to the logging failure. The request logging is warpped with"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":10,"id":"fa1b9901_f885e6ac","line":7,"updated":"2015-08-18 17:26:38.000000000","message":"s/binray/binary","commit_id":"9d74f8188b224127236e97571b1b7b83a977eb45"},{"author":{"_account_id":11022,"name":"Rodrigo Duarte Sousa","email":"rodrigodsousa@gmail.com","username":"rodrigods"},"change_message_id":"516baa3fe05b5335d894e9592900340739873c48","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Fix logging of binray contentent in request"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"The request body may containt binary file which will lead"},{"line_number":10,"context_line":"to the logging failure. The request logging is warpped with"},{"line_number":11,"context_line":"try:except to prevent that."},{"line_number":12,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":10,"id":"fa1b9901_9894eae2","line":9,"updated":"2015-08-18 17:26:38.000000000","message":"what about \"binary content\" instead of \"binary file\"?","commit_id":"9d74f8188b224127236e97571b1b7b83a977eb45"},{"author":{"_account_id":11022,"name":"Rodrigo Duarte Sousa","email":"rodrigodsousa@gmail.com","username":"rodrigods"},"change_message_id":"516baa3fe05b5335d894e9592900340739873c48","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Fix logging of binray contentent in request"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"The request body may containt binary file which will lead"},{"line_number":10,"context_line":"to the logging failure. The request logging is warpped with"},{"line_number":11,"context_line":"try:except to prevent that."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Change-Id: I844af54ec93d99636ea68ba07f48dae10368de8a"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":10,"id":"fa1b9901_38ba7e6f","line":10,"updated":"2015-08-18 17:26:38.000000000","message":"s/warpeed/wrapped","commit_id":"9d74f8188b224127236e97571b1b7b83a977eb45"}],"keystoneclient/session.py":[{"author":{"_account_id":7191,"name":"Jamie Lennox","email":"jamielennox@gmail.com","username":"jamielennox"},"change_message_id":"79cd4d332c2f819cf866473fb4a59f7070009ccc","unresolved":false,"context_lines":[{"line_number":215,"context_line":"                                    % self._process_header(header))"},{"line_number":216,"context_line":"        if json:"},{"line_number":217,"context_line":"            data \u003d jsonutils.dumps(json)"},{"line_number":218,"context_line":"        if data and not _has_binary_content(data):"},{"line_number":219,"context_line":"            string_parts.append(\"-d \u0027%s\u0027\" % data)"},{"line_number":220,"context_line":""},{"line_number":221,"context_line":"        logger.debug(\u0027 \u0027.join(string_parts))"}],"source_content_type":"text/x-python","patch_set":6,"id":"7a016987_6196d44d","line":218,"updated":"2015-05-28 02:27:00.000000000","message":"this is way too complex, off the top of my head does\n\nif data and isinstance(data, six.string_types): \n\nhandle it? Ideally i\u0027d like to print the unicode as well.","commit_id":"6c4f19836a3982e326a8ba4498b34744e64fecba"},{"author":{"_account_id":11022,"name":"Rodrigo Duarte Sousa","email":"rodrigodsousa@gmail.com","username":"rodrigods"},"change_message_id":"90e82039d56dbb7a156c688940c4cc2d0339ae95","unresolved":false,"context_lines":[{"line_number":215,"context_line":"                                    % self._process_header(header))"},{"line_number":216,"context_line":"        if json:"},{"line_number":217,"context_line":"            data \u003d jsonutils.dumps(json)"},{"line_number":218,"context_line":"        if data and not _has_binary_content(data):"},{"line_number":219,"context_line":"            string_parts.append(\"-d \u0027%s\u0027\" % data)"},{"line_number":220,"context_line":""},{"line_number":221,"context_line":"        logger.debug(\u0027 \u0027.join(string_parts))"}],"source_content_type":"text/x-python","patch_set":6,"id":"7a016987_1bf65af9","line":218,"in_reply_to":"7a016987_6196d44d","updated":"2015-05-28 14:36:21.000000000","message":"++\n\ntotally agree and I think it works, this suggestion is simpler than the ones I that I googled.","commit_id":"6c4f19836a3982e326a8ba4498b34744e64fecba"},{"author":{"_account_id":11022,"name":"Rodrigo Duarte Sousa","email":"rodrigodsousa@gmail.com","username":"rodrigods"},"change_message_id":"849a2237d61fef679717ead2d93a1f027ccc115b","unresolved":false,"context_lines":[{"line_number":77,"context_line":""},{"line_number":78,"context_line":"def _is_printable(_string):"},{"line_number":79,"context_line":"    chars \u003d set(_string)"},{"line_number":80,"context_line":"    return chars.issubset(string.printable)"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"class Session(object):"}],"source_content_type":"text/x-python","patch_set":7,"id":"7a016987_990a041f","line":80,"updated":"2015-05-31 23:26:40.000000000","message":"nice approach!","commit_id":"e45af4153fcbf6c0223fd0bf388b07f4af756cd2"},{"author":{"_account_id":7725,"name":"David Stanek","email":"dstanek@dstanek.com","username":"dstanek"},"change_message_id":"10ed164d03a7d9776c8934dd19268b181b0d8df0","unresolved":false,"context_lines":[{"line_number":77,"context_line":""},{"line_number":78,"context_line":"def _is_printable(_string):"},{"line_number":79,"context_line":"    chars \u003d set(_string)"},{"line_number":80,"context_line":"    return chars.issubset(string.printable)"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"class Session(object):"}],"source_content_type":"text/x-python","patch_set":8,"id":"7a016987_22074219","line":80,"updated":"2015-06-01 15:07:11.000000000","message":"So we can only log ascii characters?","commit_id":"23e102c38171cbf622488ad4324001cd7a058a1f"},{"author":{"_account_id":7725,"name":"David Stanek","email":"dstanek@dstanek.com","username":"dstanek"},"change_message_id":"0cfca39a56e817f53b8038050c7066aa52ce148f","unresolved":false,"context_lines":[{"line_number":192,"context_line":""},{"line_number":193,"context_line":"        try:"},{"line_number":194,"context_line":"            logger.debug(\u0027 \u0027.join(string_parts))"},{"line_number":195,"context_line":"        except (UnicodeEncodeError, UnicodeDecodeError) as e:"},{"line_number":196,"context_line":"            logger.warn(_(\"Request logging failed for encoding reason %s\")"},{"line_number":197,"context_line":"                        % e)"},{"line_number":198,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"fa1b9901_8caef083","line":195,"updated":"2015-08-18 16:00:21.000000000","message":"I don\u0027t think we need to catch both here. If we do then we need a test for each one.","commit_id":"9d74f8188b224127236e97571b1b7b83a977eb45"},{"author":{"_account_id":7132,"name":"Nikita Konovalov","email":"nkonovalov@mirantis.com","username":"nkonovalov"},"change_message_id":"d97684f04b5930575b857a5fe6753b654af07b80","unresolved":false,"context_lines":[{"line_number":192,"context_line":""},{"line_number":193,"context_line":"        try:"},{"line_number":194,"context_line":"            logger.debug(\u0027 \u0027.join(string_parts))"},{"line_number":195,"context_line":"        except (UnicodeEncodeError, UnicodeDecodeError) as e:"},{"line_number":196,"context_line":"            logger.warn(_(\"Request logging failed for encoding reason %s\")"},{"line_number":197,"context_line":"                        % e)"},{"line_number":198,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"fa1b9901_cf04b3c1","line":195,"in_reply_to":"fa1b9901_8caef083","updated":"2015-08-19 10:18:25.000000000","message":"Agree only Decode error should be handled.","commit_id":"9d74f8188b224127236e97571b1b7b83a977eb45"},{"author":{"_account_id":7725,"name":"David Stanek","email":"dstanek@dstanek.com","username":"dstanek"},"change_message_id":"0cfca39a56e817f53b8038050c7066aa52ce148f","unresolved":false,"context_lines":[{"line_number":212,"context_line":""},{"line_number":213,"context_line":"        try:"},{"line_number":214,"context_line":"            logger.debug(\u0027 \u0027.join(string_parts))"},{"line_number":215,"context_line":"        except (UnicodeEncodeError, UnicodeDecodeError) as e:"},{"line_number":216,"context_line":"            logger.warn(_(\"Response logging failed for encoding reason %s\")"},{"line_number":217,"context_line":"                        % e)"},{"line_number":218,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"fa1b9901_cccb8852","line":215,"updated":"2015-08-18 16:00:21.000000000","message":"Same here, but I don\u0027t think there are any tests for this change.","commit_id":"9d74f8188b224127236e97571b1b7b83a977eb45"},{"author":{"_account_id":17026,"name":"Sean Perry","email":"sean.perry@hpe.com","username":"sean_perry"},"change_message_id":"648efc178f9440cfa821e2ea7e46a6d0cb929e5a","unresolved":false,"context_lines":[{"line_number":37,"context_line":"_logger \u003d logging.getLogger(__name__)"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"def _safe_for_log(_string):"},{"line_number":41,"context_line":"    # The logging fails with Decode error only for Python 2.x"},{"line_number":42,"context_line":"    if sys.version_info \u003c (3, 0):"},{"line_number":43,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":13,"id":"3a29b11f_08da9e78","line":40,"updated":"2015-10-20 20:27:59.000000000","message":"Why not have this routine do something like this:\n\nif six.PY2:\n    return _string.decode(\"ascii\", \"replace\").encode(\"utf-8\")\n\nreturn _string.encode(\"utf-8\")\n\nThat way we do not drop any useful logging data.\n\nAnother option is to just call encode, catch the exception and then use the above direct decode + encode but also add \"(this text failed ASCII decoding)\" so they know it is not 100% what really happened.","commit_id":"06aa2001bb88a361d2b0d090d59770e6f28ac624"}],"keystoneclient/tests/unit/test_session.py":[{"author":{"_account_id":11022,"name":"Rodrigo Duarte Sousa","email":"rodrigodsousa@gmail.com","username":"rodrigods"},"change_message_id":"849a2237d61fef679717ead2d93a1f027ccc115b","unresolved":false,"context_lines":[{"line_number":203,"context_line":"    def test_binary_data_not_in_debug_output(self):"},{"line_number":204,"context_line":"        \"\"\"Test request and response headers in debug logs"},{"line_number":205,"context_line":""},{"line_number":206,"context_line":"        in order to redact secure headers while debug is true."},{"line_number":207,"context_line":"        \"\"\""},{"line_number":208,"context_line":"        session \u003d client_session.Session(verify\u003dFalse)"},{"line_number":209,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"7a016987_59112c51","line":206,"updated":"2015-05-31 23:26:40.000000000","message":"the docstrings are exactly the same, why not explain what the test exactly does, something like:\n\n  \"\"\"Test if binary data does not show in the debug logs.\"\"\"\n\nAnd the other way around for the previous test.","commit_id":"e45af4153fcbf6c0223fd0bf388b07f4af756cd2"},{"author":{"_account_id":7725,"name":"David Stanek","email":"dstanek@dstanek.com","username":"dstanek"},"change_message_id":"0cfca39a56e817f53b8038050c7066aa52ce148f","unresolved":false,"context_lines":[{"line_number":192,"context_line":"        session \u003d client_session.Session(verify\u003dFalse)"},{"line_number":193,"context_line":""},{"line_number":194,"context_line":"        body \u003d \u0027RESP\u0027"},{"line_number":195,"context_line":"        data \u003d u\u0027unicode_data\u0027"},{"line_number":196,"context_line":"        self.stub_url(\u0027POST\u0027, text\u003dbody)"},{"line_number":197,"context_line":"        session.post(self.TEST_URL, data\u003ddata)"},{"line_number":198,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"fa1b9901_cc96284c","line":195,"updated":"2015-08-18 16:00:21.000000000","message":"while this is a unicode object it only contains ascii characters. should this text be expanded to include non-ascii characters?","commit_id":"9d74f8188b224127236e97571b1b7b83a977eb45"},{"author":{"_account_id":7132,"name":"Nikita Konovalov","email":"nkonovalov@mirantis.com","username":"nkonovalov"},"change_message_id":"d97684f04b5930575b857a5fe6753b654af07b80","unresolved":false,"context_lines":[{"line_number":192,"context_line":"        session \u003d client_session.Session(verify\u003dFalse)"},{"line_number":193,"context_line":""},{"line_number":194,"context_line":"        body \u003d \u0027RESP\u0027"},{"line_number":195,"context_line":"        data \u003d u\u0027unicode_data\u0027"},{"line_number":196,"context_line":"        self.stub_url(\u0027POST\u0027, text\u003dbody)"},{"line_number":197,"context_line":"        session.post(self.TEST_URL, data\u003ddata)"},{"line_number":198,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"fa1b9901_4ff423f1","line":195,"in_reply_to":"fa1b9901_cc96284c","updated":"2015-08-19 10:18:25.000000000","message":"This test shows that if the unicode string contains inly printable characters it WILL be printed in the logger as usual.","commit_id":"9d74f8188b224127236e97571b1b7b83a977eb45"},{"author":{"_account_id":7725,"name":"David Stanek","email":"dstanek@dstanek.com","username":"dstanek"},"change_message_id":"0cfca39a56e817f53b8038050c7066aa52ce148f","unresolved":false,"context_lines":[{"line_number":204,"context_line":"        session \u003d client_session.Session(verify\u003dFalse)"},{"line_number":205,"context_line":""},{"line_number":206,"context_line":"        body \u003d \u0027RESP\u0027"},{"line_number":207,"context_line":"        data \u003d u\u0027\\xff\u0027"},{"line_number":208,"context_line":"        self.stub_url(\u0027POST\u0027, text\u003dbody)"},{"line_number":209,"context_line":"        session.post(self.TEST_URL, data\u003ddata)"},{"line_number":210,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"fa1b9901_ac689488","line":207,"updated":"2015-08-18 16:00:21.000000000","message":"Add a comment saying what this character is and why it wouldn\u0027t be in the output.","commit_id":"9d74f8188b224127236e97571b1b7b83a977eb45"},{"author":{"_account_id":7132,"name":"Nikita Konovalov","email":"nkonovalov@mirantis.com","username":"nkonovalov"},"change_message_id":"d97684f04b5930575b857a5fe6753b654af07b80","unresolved":false,"context_lines":[{"line_number":204,"context_line":"        session \u003d client_session.Session(verify\u003dFalse)"},{"line_number":205,"context_line":""},{"line_number":206,"context_line":"        body \u003d \u0027RESP\u0027"},{"line_number":207,"context_line":"        data \u003d u\u0027\\xff\u0027"},{"line_number":208,"context_line":"        self.stub_url(\u0027POST\u0027, text\u003dbody)"},{"line_number":209,"context_line":"        session.post(self.TEST_URL, data\u003ddata)"},{"line_number":210,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"fa1b9901_8f5f9be4","line":207,"in_reply_to":"fa1b9901_ac689488","updated":"2015-08-19 10:18:25.000000000","message":"And this shows that a non ascii symbol (ff \u003e 128) no matter where does it come from cannot be decoded and thats why it DOES NOT appear in the output.","commit_id":"9d74f8188b224127236e97571b1b7b83a977eb45"}]}
