)]}'
{"bandit/core/formatters.py":[{"author":{"_account_id":8119,"name":"Eric Brown","email":"eric_wade_brown@yahoo.com","username":"ericwb"},"change_message_id":"81fa639aae3bc3b0a6034c0207020f2d2aa2a23b","unresolved":false,"context_lines":[{"line_number":66,"context_line":"                writer.writerow(result.as_dict(with_code\u003dFalse))"},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"        print(\"CSV output written to file: %s\" % filename)"},{"line_number":69,"context_line":"    except Exception:"},{"line_number":70,"context_line":"        raise"},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"    finally:"}],"source_content_type":"text/x-python","patch_set":2,"id":"da20952f_79a73550","line":69,"updated":"2015-09-04 19:36:03.000000000","message":"Probably better as\n\nexcept (OSError, IOError):","commit_id":"cf83b899fceb26ae84f4823431af99305d01ed6e"},{"author":{"_account_id":8119,"name":"Eric Brown","email":"eric_wade_brown@yahoo.com","username":"ericwb"},"change_message_id":"81fa639aae3bc3b0a6034c0207020f2d2aa2a23b","unresolved":false,"context_lines":[{"line_number":274,"context_line":"        tree.write(out, encoding\u003d\u0027utf-8\u0027, xml_declaration\u003dTrue)"},{"line_number":275,"context_line":""},{"line_number":276,"context_line":"        print(\"XML output written to file: %s\" % filename)"},{"line_number":277,"context_line":"    except Exception:"},{"line_number":278,"context_line":"        raise"},{"line_number":279,"context_line":"    finally:"},{"line_number":280,"context_line":"        if filename is not None:"}],"source_content_type":"text/x-python","patch_set":2,"id":"da20952f_99a4894b","line":277,"updated":"2015-09-04 19:36:03.000000000","message":"Probably better as\n\nexcept (OSError, IOError):","commit_id":"cf83b899fceb26ae84f4823431af99305d01ed6e"},{"author":{"_account_id":12000,"name":"Ian Cordasco","email":"sigmavirus24@gmail.com","username":"sigmavirus24"},"change_message_id":"4396b85c810b16d45a6d432d35519eff4af4168b","unresolved":false,"context_lines":[{"line_number":66,"context_line":"                writer.writerow(result.as_dict(with_code\u003dFalse))"},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"        print(\"CSV output written to file: %s\" % filename)"},{"line_number":69,"context_line":"    except Exception:"},{"line_number":70,"context_line":"        raise"},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"    finally:"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a1a9d01_87b780d7","line":69,"updated":"2015-09-28 16:55:57.000000000","message":"Can we please be more specific with the exception(s) we expect to see here?","commit_id":"e5be102f41651891ead71db86c8b810defeb3265"},{"author":{"_account_id":12000,"name":"Ian Cordasco","email":"sigmavirus24@gmail.com","username":"sigmavirus24"},"change_message_id":"4396b85c810b16d45a6d432d35519eff4af4168b","unresolved":false,"context_lines":[{"line_number":249,"context_line":""},{"line_number":250,"context_line":"    try:"},{"line_number":251,"context_line":"        if filename is not None:"},{"line_number":252,"context_line":"            out \u003d open(filename, \u0027wb\u0027)"},{"line_number":253,"context_line":"        else:"},{"line_number":254,"context_line":"            out \u003d sys.stdout"},{"line_number":255,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"9a1a9d01_a7bac4be","line":252,"updated":"2015-09-28 16:55:57.000000000","message":"Given the duplication, I\u0027m inclined to suggest that we create a context-manager to handle this for us. It would look something like\n\n\n    with output_file(filename, mode, [OSError, AssertionError, IOError, ...]):\n       issues \u003d manager.get_issue_list()\n       root \u003d ET.Element(...)\n\n       # etc.\n\nWhere we define the context manager as \n\n    import contextlib\n\n    @contextlib.contextmanager\n    def output_file(filename, filemode, list_of_exceptions):\n        isfileoutput \u003d filename is not None\n        try:\n            out \u003d sys.stdout\n            if isfileoutput:\n                out \u003d open(filename, filemode)\n\n            yield\n\n        except list_of_exceptions:\n            raise\n        finally:\n            if isfileoutput:\n                out.close()\n\nThis will make it easier for other plugins to use this as well when they please.","commit_id":"e5be102f41651891ead71db86c8b810defeb3265"}]}
