)]}'
{"nova/api/openstack/wsgi.py":[{"author":{"_account_id":100,"name":"Johannes Erdfelt","email":"johannes@erdfelt.com","username":"johannes.erdfelt"},"change_message_id":"f5c210da604fb4fbae1411b3331a29d505bc7f86","unresolved":false,"context_lines":[{"line_number":890,"context_line":"        try:"},{"line_number":891,"context_line":"            return self._process_stack(request, action, action_args,"},{"line_number":892,"context_line":"                                   content_type, body, accept)"},{"line_number":893,"context_line":"        except LookupError as e:"},{"line_number":894,"context_line":"            #NOTE(Vijaya Erukala): XML input such as"},{"line_number":895,"context_line":"            #                      \u003c?xml version\u003d\"1.0\" encoding\u003d\"TF-8\"?\u003e"},{"line_number":896,"context_line":"            #                      raises LookupError: unknown encoding: TF-8"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAM3%2F%2BktQ%3D","line":893,"updated":"2013-02-27 00:13:37.000000000","message":"LookupError isn\u0027t declared or imported in this file. Since we\u0027re touching this file, maybe we should fix this, or move this as well since it seems to equally affect other users too.","commit_id":"71a4f731a40053b9f7eefd8a5ad7e63cf25758a6"},{"author":{"_account_id":100,"name":"Johannes Erdfelt","email":"johannes@erdfelt.com","username":"johannes.erdfelt"},"change_message_id":"35a487d622181568ebdf7cf6d3fe4ff666961e97","unresolved":false,"context_lines":[{"line_number":890,"context_line":"        try:"},{"line_number":891,"context_line":"            return self._process_stack(request, action, action_args,"},{"line_number":892,"context_line":"                                   content_type, body, accept)"},{"line_number":893,"context_line":"        except LookupError as e:"},{"line_number":894,"context_line":"            #NOTE(Vijaya Erukala): XML input such as"},{"line_number":895,"context_line":"            #                      \u003c?xml version\u003d\"1.0\" encoding\u003d\"TF-8\"?\u003e"},{"line_number":896,"context_line":"            #                      raises LookupError: unknown encoding: TF-8"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAM3%2F%2BkZo%3D","line":893,"in_reply_to":"AAAAM3%2F%2BkqM%3D","updated":"2013-02-27 03:22:28.000000000","message":"Sorry, I completely forgot that LookupError is a builtin. (Duh)\n\nHowever, I think you\u0027re misreading the comment. It appears to be completely unrelated to the exception handler here.\n\nIf you look at the comment below, it\u0027s specifically about how an invalid encoding can generate the LookupError. Looking at the python docs, that is from the codecs module.\n\nSince LookupError is a fairly nonspecific exception (it\u0027s the parent class for IndexError and KeyError) it\u0027s probably an even better candidate to hoist even further up to safe_minidom_parse_string() so it doesn\u0027t incorrectly catch a legitimate KeyError/IndexError and return a 400 to the client incorrectly.","commit_id":"71a4f731a40053b9f7eefd8a5ad7e63cf25758a6"},{"author":{"_account_id":4419,"name":"Matthew Sherborne","email":"msherborne+openstack@gmail.com","username":"msherborne+openstack"},"change_message_id":"f4f59c1136f9754b627faf72846bdfd6c4509169","unresolved":false,"context_lines":[{"line_number":890,"context_line":"        try:"},{"line_number":891,"context_line":"            return self._process_stack(request, action, action_args,"},{"line_number":892,"context_line":"                                   content_type, body, accept)"},{"line_number":893,"context_line":"        except LookupError as e:"},{"line_number":894,"context_line":"            #NOTE(Vijaya Erukala): XML input such as"},{"line_number":895,"context_line":"            #                      \u003c?xml version\u003d\"1.0\" encoding\u003d\"TF-8\"?\u003e"},{"line_number":896,"context_line":"            #                      raises LookupError: unknown encoding: TF-8"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAM3%2F%2BkqM%3D","line":893,"in_reply_to":"AAAAM3%2F%2BktQ%3D","updated":"2013-02-27 00:24:34.000000000","message":"LookupError is built in to python; no import necessary:\n\n\u003e\u003e\u003e __builtins__.LookupError\n\u003ctype \u0027exceptions.LookupError\u0027\u003e\n\nI was unable to move it down because a bunch of tests rely on it being where it is. I think it\u0027s due to that comment above it:\n\n\"Splitting the function up this way allows for auditing by external tools that wrap the existing function.\"","commit_id":"71a4f731a40053b9f7eefd8a5ad7e63cf25758a6"},{"author":{"_account_id":100,"name":"Johannes Erdfelt","email":"johannes@erdfelt.com","username":"johannes.erdfelt"},"change_message_id":"c21cf57b1fb49d143bf07b5923541c223794b2cd","unresolved":false,"context_lines":[{"line_number":890,"context_line":"        try:"},{"line_number":891,"context_line":"            return self._process_stack(request, action, action_args,"},{"line_number":892,"context_line":"                                   content_type, body, accept)"},{"line_number":893,"context_line":"        except LookupError as e:"},{"line_number":894,"context_line":"            #NOTE(Vijaya Erukala): XML input such as"},{"line_number":895,"context_line":"            #                      \u003c?xml version\u003d\"1.0\" encoding\u003d\"TF-8\"?\u003e"},{"line_number":896,"context_line":"            #                      raises LookupError: unknown encoding: TF-8"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAN3%2F%2F6xI%3D","line":893,"updated":"2013-03-06 14:49:07.000000000","message":"I\u0027d still like to see this moved with the expat.ExpatError handler too. It\u0027s another way for invalid input to raise a 500 in error in every other place you\u0027ve moved.\n\nAlso worse is that keeping this exception here could return 400 in places where a 500 really should be returned!","commit_id":"c8e3132ad8f0d51ac62cd220189a1db795e52afe"},{"author":{"_account_id":100,"name":"Johannes Erdfelt","email":"johannes@erdfelt.com","username":"johannes.erdfelt"},"change_message_id":"8f29bdef687f651132e663a3a53132c323cfffbf","unresolved":false,"context_lines":[{"line_number":887,"context_line":"        try:"},{"line_number":888,"context_line":"            return self._process_stack(request, action, action_args,"},{"line_number":889,"context_line":"                                   content_type, body, accept)"},{"line_number":890,"context_line":"        except LookupError as e:"},{"line_number":891,"context_line":"            #NOTE(Vijaya Erukala): XML input such as"},{"line_number":892,"context_line":"            #                      \u003c?xml version\u003d\"1.0\" encoding\u003d\"TF-8\"?\u003e"},{"line_number":893,"context_line":"            #                      raises LookupError: unknown encoding: TF-8"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAN3%2F%2FwuA%3D","line":890,"updated":"2013-03-13 14:02:06.000000000","message":"Are you seeing my comments? I\u0027ve brought up issues with this code a couple of times but no replies and no changes...","commit_id":"b9e1477035aee9676c7209d06ed1c17d466d485c"},{"author":{"_account_id":4419,"name":"Matthew Sherborne","email":"msherborne+openstack@gmail.com","username":"msherborne+openstack"},"change_message_id":"f3a747f790d5beaf43e19af67a90b8a43a38f906","unresolved":false,"context_lines":[{"line_number":887,"context_line":"        try:"},{"line_number":888,"context_line":"            return self._process_stack(request, action, action_args,"},{"line_number":889,"context_line":"                                   content_type, body, accept)"},{"line_number":890,"context_line":"        except LookupError as e:"},{"line_number":891,"context_line":"            #NOTE(Vijaya Erukala): XML input such as"},{"line_number":892,"context_line":"            #                      \u003c?xml version\u003d\"1.0\" encoding\u003d\"TF-8\"?\u003e"},{"line_number":893,"context_line":"            #                      raises LookupError: unknown encoding: TF-8"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAN3%2F%2FwCw%3D","line":890,"in_reply_to":"AAAAN3%2F%2FwuA%3D","updated":"2013-03-13 20:37:29.000000000","message":"Sorry Johannes, I though I had moved this to safe_minidom_parse_string, but it looks like I just copied it :o  .. moving it now..","commit_id":"b9e1477035aee9676c7209d06ed1c17d466d485c"}],"nova/api/openstack/xmlutil.py":[{"author":{"_account_id":100,"name":"Johannes Erdfelt","email":"johannes@erdfelt.com","username":"johannes.erdfelt"},"change_message_id":"25db56b3defb11e4f922f33559e52624a3a5e0a6","unresolved":false,"context_lines":[{"line_number":960,"context_line":"    try:"},{"line_number":961,"context_line":"        return minidom.parseString(xml_string, parser\u003dProtectedExpatParser())"},{"line_number":962,"context_line":"    except (sax.SAXParseException, ValueError) as e:"},{"line_number":963,"context_line":"        raise exception.MalformedRequestBody(reason\u003de.message)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAM3%2F%2BkZQ%3D","line":963,"updated":"2013-02-27 03:28:17.000000000","message":"message attribute on an exception is deprecated. Use:\n\n  unicode(e)\n\ninstead.","commit_id":"8a52467e21fbc03ae115795c2f343f9c63df743b"},{"author":{"_account_id":100,"name":"Johannes Erdfelt","email":"johannes@erdfelt.com","username":"johannes.erdfelt"},"change_message_id":"e2f571bc38152669981a3aad8aa1de54570ee070","unresolved":false,"context_lines":[{"line_number":960,"context_line":"    \"\"\"Parse an XML string using minidom safely.\"\"\""},{"line_number":961,"context_line":"    try:"},{"line_number":962,"context_line":"        return minidom.parseString(xml_string, parser\u003dProtectedExpatParser())"},{"line_number":963,"context_line":"    except (sax.SAXParseException, ValueError,"},{"line_number":964,"context_line":"            expat.ExpatError, LookupError) as e:"},{"line_number":965,"context_line":"        #NOTE(Vijaya Erukala): XML input such as"},{"line_number":966,"context_line":"        #                      \u003c?xml version\u003d\"1.0\" encoding\u003d\"TF-8\"?\u003e"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAN3%2F%2FvDs%3D","line":963,"updated":"2013-03-14 15:18:06.000000000","message":"Do you how/when these two exceptions can get raised? I didn\u0027t see any other code catching ValueError, but I do see the tests are depending on ValueError.","commit_id":"3478f1e121d84d15558d338a32315f13250cf3bb"}],"nova/utils.py":[{"author":{"_account_id":100,"name":"Johannes Erdfelt","email":"johannes@erdfelt.com","username":"johannes.erdfelt"},"change_message_id":"8966d6c4f39356c833947665ad4bc9bd999384f6","unresolved":false,"context_lines":[{"line_number":36,"context_line":"import sys"},{"line_number":37,"context_line":"import tempfile"},{"line_number":38,"context_line":"import time"},{"line_number":39,"context_line":"from xml.dom import minidom"},{"line_number":40,"context_line":"from xml.parsers import expat"},{"line_number":41,"context_line":"from xml import sax"},{"line_number":42,"context_line":"from xml.sax import expatreader"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAM3%2F%2BmlY%3D","line":39,"updated":"2013-02-26 02:32:19.000000000","message":"This appears to be unused now (see pep8 errors)","commit_id":"9e33adcc94a5cf50d3349db1b1788357398e454d"},{"author":{"_account_id":4419,"name":"Matthew Sherborne","email":"msherborne+openstack@gmail.com","username":"msherborne+openstack"},"change_message_id":"7c7f46144af6c52546c01916a792c77ba4dd7bc2","unresolved":false,"context_lines":[{"line_number":36,"context_line":"import sys"},{"line_number":37,"context_line":"import tempfile"},{"line_number":38,"context_line":"import time"},{"line_number":39,"context_line":"from xml.dom import minidom"},{"line_number":40,"context_line":"from xml.parsers import expat"},{"line_number":41,"context_line":"from xml import sax"},{"line_number":42,"context_line":"from xml.sax import expatreader"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAM3%2F%2BmFE%3D","line":39,"in_reply_to":"AAAAM3%2F%2BmlY%3D","updated":"2013-02-26 12:04:12.000000000","message":"Done","commit_id":"9e33adcc94a5cf50d3349db1b1788357398e454d"},{"author":{"_account_id":100,"name":"Johannes Erdfelt","email":"johannes@erdfelt.com","username":"johannes.erdfelt"},"change_message_id":"8966d6c4f39356c833947665ad4bc9bd999384f6","unresolved":false,"context_lines":[{"line_number":691,"context_line":"    \"\"\"Parse an XML string using minidom safely.\"\"\""},{"line_number":692,"context_line":"    try:"},{"line_number":693,"context_line":"        return minidom.parseString(xml_string, parser\u003dProtectedExpatParser())"},{"line_number":694,"context_line":"    except sax.SAXParseException as se:"},{"line_number":695,"context_line":"        msg \u003d _(\"cannot understand XML\")"},{"line_number":696,"context_line":"        raise exception.MalformedRequestBody(reason\u003dmsg)"},{"line_number":697,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAM3%2F%2Bmlo%3D","line":694,"updated":"2013-02-26 02:32:19.000000000","message":"se is unused here. Can you remove it?","commit_id":"9e33adcc94a5cf50d3349db1b1788357398e454d"},{"author":{"_account_id":4419,"name":"Matthew Sherborne","email":"msherborne+openstack@gmail.com","username":"msherborne+openstack"},"change_message_id":"7c7f46144af6c52546c01916a792c77ba4dd7bc2","unresolved":false,"context_lines":[{"line_number":691,"context_line":"    \"\"\"Parse an XML string using minidom safely.\"\"\""},{"line_number":692,"context_line":"    try:"},{"line_number":693,"context_line":"        return minidom.parseString(xml_string, parser\u003dProtectedExpatParser())"},{"line_number":694,"context_line":"    except sax.SAXParseException as se:"},{"line_number":695,"context_line":"        msg \u003d _(\"cannot understand XML\")"},{"line_number":696,"context_line":"        raise exception.MalformedRequestBody(reason\u003dmsg)"},{"line_number":697,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAM3%2F%2BmFI%3D","line":694,"in_reply_to":"AAAAM3%2F%2Bmlo%3D","updated":"2013-02-26 12:04:12.000000000","message":"Done","commit_id":"9e33adcc94a5cf50d3349db1b1788357398e454d"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"17703c68add530a38a307971677f0cf968608909","unresolved":false,"context_lines":[{"line_number":686,"context_line":"            self._parser.UnparsedEntityDeclHandler \u003d self.unparsed_entity_decl"},{"line_number":687,"context_line":""},{"line_number":688,"context_line":""},{"line_number":689,"context_line":"def safe_minidom_parse_string(xml_string):"},{"line_number":690,"context_line":"    \"\"\"Parse an XML string using minidom safely.\"\"\""},{"line_number":691,"context_line":"    try:"},{"line_number":692,"context_line":"        return minidom.parseString(xml_string, parser\u003dProtectedExpatParser())"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAM3%2F%2BlKk%3D","line":689,"updated":"2013-02-26 20:25:57.000000000","message":"I\u0027d like this better in nova/api/openstack/xmlutil\n\nIt has no callers outside the API layer.","commit_id":"71a4f731a40053b9f7eefd8a5ad7e63cf25758a6"},{"author":{"_account_id":4419,"name":"Matthew Sherborne","email":"msherborne+openstack@gmail.com","username":"msherborne+openstack"},"change_message_id":"f4f59c1136f9754b627faf72846bdfd6c4509169","unresolved":false,"context_lines":[{"line_number":686,"context_line":"            self._parser.UnparsedEntityDeclHandler \u003d self.unparsed_entity_decl"},{"line_number":687,"context_line":""},{"line_number":688,"context_line":""},{"line_number":689,"context_line":"def safe_minidom_parse_string(xml_string):"},{"line_number":690,"context_line":"    \"\"\"Parse an XML string using minidom safely.\"\"\""},{"line_number":691,"context_line":"    try:"},{"line_number":692,"context_line":"        return minidom.parseString(xml_string, parser\u003dProtectedExpatParser())"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAM3%2F%2Bkps%3D","line":689,"in_reply_to":"AAAAM3%2F%2BlKk%3D","updated":"2013-02-27 00:24:34.000000000","message":"Good idea, will move it now.","commit_id":"71a4f731a40053b9f7eefd8a5ad7e63cf25758a6"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"17703c68add530a38a307971677f0cf968608909","unresolved":false,"context_lines":[{"line_number":690,"context_line":"    \"\"\"Parse an XML string using minidom safely.\"\"\""},{"line_number":691,"context_line":"    try:"},{"line_number":692,"context_line":"        return minidom.parseString(xml_string, parser\u003dProtectedExpatParser())"},{"line_number":693,"context_line":"    except sax.SAXParseException:"},{"line_number":694,"context_line":"        msg \u003d _(\"cannot understand XML\")"},{"line_number":695,"context_line":"        raise exception.MalformedRequestBody(reason\u003dmsg)"},{"line_number":696,"context_line":"    except ValueError:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAM3%2F%2BlKg%3D","line":693,"updated":"2013-02-26 20:25:57.000000000","message":"can shorten the two exception clauses:\n\nexcept (sax.SAXParseException, ValueError):\n  ...","commit_id":"71a4f731a40053b9f7eefd8a5ad7e63cf25758a6"},{"author":{"_account_id":4419,"name":"Matthew Sherborne","email":"msherborne+openstack@gmail.com","username":"msherborne+openstack"},"change_message_id":"f4f59c1136f9754b627faf72846bdfd6c4509169","unresolved":false,"context_lines":[{"line_number":690,"context_line":"    \"\"\"Parse an XML string using minidom safely.\"\"\""},{"line_number":691,"context_line":"    try:"},{"line_number":692,"context_line":"        return minidom.parseString(xml_string, parser\u003dProtectedExpatParser())"},{"line_number":693,"context_line":"    except sax.SAXParseException:"},{"line_number":694,"context_line":"        msg \u003d _(\"cannot understand XML\")"},{"line_number":695,"context_line":"        raise exception.MalformedRequestBody(reason\u003dmsg)"},{"line_number":696,"context_line":"    except ValueError:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAM3%2F%2Bkpo%3D","line":693,"in_reply_to":"AAAAM3%2F%2BlKg%3D","updated":"2013-02-27 00:24:34.000000000","message":"Will do.","commit_id":"71a4f731a40053b9f7eefd8a5ad7e63cf25758a6"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"17703c68add530a38a307971677f0cf968608909","unresolved":false,"context_lines":[{"line_number":691,"context_line":"    try:"},{"line_number":692,"context_line":"        return minidom.parseString(xml_string, parser\u003dProtectedExpatParser())"},{"line_number":693,"context_line":"    except sax.SAXParseException:"},{"line_number":694,"context_line":"        msg \u003d _(\"cannot understand XML\")"},{"line_number":695,"context_line":"        raise exception.MalformedRequestBody(reason\u003dmsg)"},{"line_number":696,"context_line":"    except ValueError:"},{"line_number":697,"context_line":"        msg \u003d _(\"cannot understand XML\")"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAM3%2F%2BlKM%3D","line":694,"updated":"2013-02-26 20:25:57.000000000","message":"What\u0027s the actual exception message look like?  This msg is very generic.","commit_id":"71a4f731a40053b9f7eefd8a5ad7e63cf25758a6"},{"author":{"_account_id":4419,"name":"Matthew Sherborne","email":"msherborne+openstack@gmail.com","username":"msherborne+openstack"},"change_message_id":"f4f59c1136f9754b627faf72846bdfd6c4509169","unresolved":false,"context_lines":[{"line_number":691,"context_line":"    try:"},{"line_number":692,"context_line":"        return minidom.parseString(xml_string, parser\u003dProtectedExpatParser())"},{"line_number":693,"context_line":"    except sax.SAXParseException:"},{"line_number":694,"context_line":"        msg \u003d _(\"cannot understand XML\")"},{"line_number":695,"context_line":"        raise exception.MalformedRequestBody(reason\u003dmsg)"},{"line_number":696,"context_line":"    except ValueError:"},{"line_number":697,"context_line":"        msg \u003d _(\"cannot understand XML\")"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAM3%2F%2Bkpw%3D","line":694,"in_reply_to":"AAAAM3%2F%2BlKM%3D","updated":"2013-02-27 00:24:34.000000000","message":"The Message gets eaten anyway when it is re-raised here:\n\nhttps://github.com/openstack/nova/blob/master/nova/api/openstack/wsgi.py#L921","commit_id":"71a4f731a40053b9f7eefd8a5ad7e63cf25758a6"}]}
