)]}'
{"nova/api/validation/validators.py":[{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"30af70078f58dc59fc5e4ba1f55ffaec14083fad","unresolved":false,"context_lines":[{"line_number":45,"context_line":"@jsonschema.FormatChecker.cls_checks(\u0027base64\u0027)"},{"line_number":46,"context_line":"def _validate_base64_format(instance):"},{"line_number":47,"context_line":"    try:"},{"line_number":48,"context_line":"        if isinstance(instance, six.text_type):"},{"line_number":49,"context_line":"            instance \u003d instance.encode(\u0027utf-8\u0027)"},{"line_number":50,"context_line":"        if six.PY2:"},{"line_number":51,"context_line":"            base64.decodestring(instance)"},{"line_number":52,"context_line":"        else:"},{"line_number":53,"context_line":"            base64.decodebytes(instance)"},{"line_number":54,"context_line":"    except base64.binascii.Error:"},{"line_number":55,"context_line":"        return False"},{"line_number":56,"context_line":"    except TypeError:"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a6eadb0_9f7dc01e","line":53,"range":{"start_line":48,"start_character":0,"end_line":53,"end_character":40},"updated":"2016-12-14 18:33:04.000000000","message":"Further to what Sylvain says, this whole block could be replaced by decode_as_bytes [0].\n\n[0] http://docs.openstack.org/developer/oslo.serialization/api.html#oslo_serialization.base64.decode_as_bytes","commit_id":"3cf91cc5aa215cb67328c116eb03880ada450e6b"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"91f39d492339db6e42b8348cb1630d2f4b40bd25","unresolved":false,"context_lines":[{"line_number":50,"context_line":"        if six.PY2:"},{"line_number":51,"context_line":"            base64.decodestring(instance)"},{"line_number":52,"context_line":"        else:"},{"line_number":53,"context_line":"            base64.decodebytes(instance)"},{"line_number":54,"context_line":"    except base64.binascii.Error:"},{"line_number":55,"context_line":"        return False"},{"line_number":56,"context_line":"    except TypeError:"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a6eadb0_babac021","line":53,"updated":"2016-12-13 21:23:15.000000000","message":"We should rather use what they call the \"modern interface\" and just use base64.b64decode() with a byte-encoded string.\n\nhttps://docs.python.org/3/library/base64.html#base64.b64decode","commit_id":"3cf91cc5aa215cb67328c116eb03880ada450e6b"}]}
