)]}'
{"pbr/packaging.py":[{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"9a8ddb9a3d2dee600370182d2ec7af7cd2bff5fe","unresolved":false,"context_lines":[{"line_number":261,"context_line":"    import wsgiref.simple_server as wss"},{"line_number":262,"context_line":""},{"line_number":263,"context_line":"    my_ip \u003d socket.gethostbyname(socket.gethostname())"},{"line_number":264,"context_line":"    if \u0027oslo_config\u0027 in sys.modules:"},{"line_number":265,"context_line":"        from oslo_config import cfg"},{"line_number":266,"context_line":"        cfg.CONF.register_cli_opt("},{"line_number":267,"context_line":"            cfg.PortOpt(\u0027port\u0027,"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa0719c6_20574327","line":264,"range":{"start_line":264,"start_character":4,"end_line":264,"end_character":35},"updated":"2016-03-23 10:37:30.000000000","message":"This seems very fragile. :(","commit_id":"d9c3cacc1902a471ef917cf482a35c7f30204c0c"},{"author":{"_account_id":7385,"name":"Thomas Herve","email":"therve@redhat.com","username":"therve"},"change_message_id":"bfc9b9ca9d0d76b56ad41718c51405371653677d","unresolved":false,"context_lines":[{"line_number":261,"context_line":"    import wsgiref.simple_server as wss"},{"line_number":262,"context_line":""},{"line_number":263,"context_line":"    my_ip \u003d socket.gethostbyname(socket.gethostname())"},{"line_number":264,"context_line":"    if \u0027oslo_config\u0027 in sys.modules:"},{"line_number":265,"context_line":"        from oslo_config import cfg"},{"line_number":266,"context_line":"        cfg.CONF.register_cli_opt("},{"line_number":267,"context_line":"            cfg.PortOpt(\u0027port\u0027,"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa0719c6_5beb4c13","line":264,"range":{"start_line":264,"start_character":4,"end_line":264,"end_character":35},"in_reply_to":"fa0719c6_20574327","updated":"2016-03-23 10:41:30.000000000","message":"Suggestions welcome :). It has the benefit of not requiring specific lib.","commit_id":"d9c3cacc1902a471ef917cf482a35c7f30204c0c"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"9a8ddb9a3d2dee600370182d2ec7af7cd2bff5fe","unresolved":false,"context_lines":[{"line_number":263,"context_line":"    my_ip \u003d socket.gethostbyname(socket.gethostname())"},{"line_number":264,"context_line":"    if \u0027oslo_config\u0027 in sys.modules:"},{"line_number":265,"context_line":"        from oslo_config import cfg"},{"line_number":266,"context_line":"        cfg.CONF.register_cli_opt("},{"line_number":267,"context_line":"            cfg.PortOpt(\u0027port\u0027,"},{"line_number":268,"context_line":"                    default\u003d8000,"},{"line_number":269,"context_line":"                    help\u003d\u0027Port number to listen on.\u0027))"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa0719c6_0002ff0a","line":266,"range":{"start_line":266,"start_character":8,"end_line":266,"end_character":34},"updated":"2016-03-23 10:37:30.000000000","message":"Except that this is not going to work with the cool apps out there that do not rely on the global cfg.CONF object, right?","commit_id":"d9c3cacc1902a471ef917cf482a35c7f30204c0c"},{"author":{"_account_id":7385,"name":"Thomas Herve","email":"therve@redhat.com","username":"therve"},"change_message_id":"bfc9b9ca9d0d76b56ad41718c51405371653677d","unresolved":false,"context_lines":[{"line_number":263,"context_line":"    my_ip \u003d socket.gethostbyname(socket.gethostname())"},{"line_number":264,"context_line":"    if \u0027oslo_config\u0027 in sys.modules:"},{"line_number":265,"context_line":"        from oslo_config import cfg"},{"line_number":266,"context_line":"        cfg.CONF.register_cli_opt("},{"line_number":267,"context_line":"            cfg.PortOpt(\u0027port\u0027,"},{"line_number":268,"context_line":"                    default\u003d8000,"},{"line_number":269,"context_line":"                    help\u003d\u0027Port number to listen on.\u0027))"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa0719c6_5bd22c5d","line":266,"range":{"start_line":266,"start_character":8,"end_line":266,"end_character":34},"in_reply_to":"fa0719c6_0002ff0a","updated":"2016-03-23 10:41:30.000000000","message":"I don\u0027t know. Presumably it doesn\u0027t work currently anyway. If you have such an app testing would be nice.","commit_id":"d9c3cacc1902a471ef917cf482a35c7f30204c0c"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"5d89a43e489f63c1aa1e047f567d7cf1d83edcce","unresolved":false,"context_lines":[{"line_number":278,"context_line":"                            help\u003d\u0027TCP port to listen on\u0027)"},{"line_number":279,"context_line":"        args \u003d parser.parse_args()"},{"line_number":280,"context_line":"        port \u003d args.port"},{"line_number":281,"context_line":"        app \u003d %(invoke_target)s()"},{"line_number":282,"context_line":"    server \u003d wss.make_server(\u0027\u0027, port, app)"},{"line_number":283,"context_line":""},{"line_number":284,"context_line":"    print(\"*\" * 80)"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa0719c6_edfa5b74","line":281,"range":{"start_line":281,"start_character":8,"end_line":281,"end_character":33},"updated":"2016-03-23 13:03:46.000000000","message":"This can be factorized btw.","commit_id":"d9c3cacc1902a471ef917cf482a35c7f30204c0c"},{"author":{"_account_id":12612,"name":"Sachi King","email":"nakato@nakato.io","username":"nakato"},"change_message_id":"2617253b35b4a67552ad3d1aa8f4c12e996176df","unresolved":false,"context_lines":[{"line_number":265,"context_line":"    parser \u003d argparse.ArgumentParser("},{"line_number":266,"context_line":"        description\u003d%(import_target)s.__doc__,"},{"line_number":267,"context_line":"        formatter_class\u003dargparse.ArgumentDefaultsHelpFormatter,"},{"line_number":268,"context_line":"        usage\u003d\u0027%%(prog)s [-h] [--port PORT] [-- [options]]\u0027)"},{"line_number":269,"context_line":"    parser.add_argument(\u0027--port\u0027, \u0027-p\u0027, type\u003dint, default\u003d8000,"},{"line_number":270,"context_line":"                        help\u003d\u0027TCP port to listen on\u0027)"},{"line_number":271,"context_line":"    args, remainder \u003d parser.parse_known_args()"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba0121b8_f8441f1c","line":268,"range":{"start_line":268,"start_character":49,"end_line":268,"end_character":56},"updated":"2016-03-30 00:24:20.000000000","message":"[-- [passed-options]], or something that makes it clear that the following options will be pass on.\n\nif we pass --help into a wsgi application, what happens?  I assume something\u0027s going to happen at make_server, which may be unexpected to this application.","commit_id":"49f537f93beeb8b8ff19776fac5ef4f99ea7a57f"},{"author":{"_account_id":12612,"name":"Sachi King","email":"nakato@nakato.io","username":"nakato"},"change_message_id":"25bbbc2ef4f70c21b315598e02f083b1d5cc735f","unresolved":false,"context_lines":[{"line_number":265,"context_line":"    parser \u003d argparse.ArgumentParser("},{"line_number":266,"context_line":"        description\u003d%(import_target)s.__doc__,"},{"line_number":267,"context_line":"        formatter_class\u003dargparse.ArgumentDefaultsHelpFormatter,"},{"line_number":268,"context_line":"        usage\u003d\u0027%%(prog)s [-h] [--port PORT] [-- [options]]\u0027)"},{"line_number":269,"context_line":"    parser.add_argument(\u0027--port\u0027, \u0027-p\u0027, type\u003dint, default\u003d8000,"},{"line_number":270,"context_line":"                        help\u003d\u0027TCP port to listen on\u0027)"},{"line_number":271,"context_line":"    args, remainder \u003d parser.parse_known_args()"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba0121b8_69ec402a","line":268,"range":{"start_line":268,"start_character":49,"end_line":268,"end_character":56},"in_reply_to":"ba0121b8_d1bac26d","updated":"2016-04-01 01:46:37.000000000","message":"I was worrying about how the app exits when --help is used with common argument parsers and how they exit when that happens from wss.make_server.  Both oslo.config and argparse call exit, so the app exits cleanly and all is good.","commit_id":"49f537f93beeb8b8ff19776fac5ef4f99ea7a57f"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"f6028a5a8771144ce7cbf61056659ea613cb05b0","unresolved":false,"context_lines":[{"line_number":265,"context_line":"    parser \u003d argparse.ArgumentParser("},{"line_number":266,"context_line":"        description\u003d%(import_target)s.__doc__,"},{"line_number":267,"context_line":"        formatter_class\u003dargparse.ArgumentDefaultsHelpFormatter,"},{"line_number":268,"context_line":"        usage\u003d\u0027%%(prog)s [-h] [--port PORT] [-- [options]]\u0027)"},{"line_number":269,"context_line":"    parser.add_argument(\u0027--port\u0027, \u0027-p\u0027, type\u003dint, default\u003d8000,"},{"line_number":270,"context_line":"                        help\u003d\u0027TCP port to listen on\u0027)"},{"line_number":271,"context_line":"    args, remainder \u003d parser.parse_known_args()"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba0121b8_d1bac26d","line":268,"range":{"start_line":268,"start_character":49,"end_line":268,"end_character":56},"in_reply_to":"ba0121b8_f8441f1c","updated":"2016-03-30 10:48:10.000000000","message":"Nothing happens if you pass --help to the application, it\u0027s up to the app to parse or not sys.argv.","commit_id":"49f537f93beeb8b8ff19776fac5ef4f99ea7a57f"},{"author":{"_account_id":12612,"name":"Sachi King","email":"nakato@nakato.io","username":"nakato"},"change_message_id":"2617253b35b4a67552ad3d1aa8f4c12e996176df","unresolved":false,"context_lines":[{"line_number":268,"context_line":"        usage\u003d\u0027%%(prog)s [-h] [--port PORT] [-- [options]]\u0027)"},{"line_number":269,"context_line":"    parser.add_argument(\u0027--port\u0027, \u0027-p\u0027, type\u003dint, default\u003d8000,"},{"line_number":270,"context_line":"                        help\u003d\u0027TCP port to listen on\u0027)"},{"line_number":271,"context_line":"    args, remainder \u003d parser.parse_known_args()"},{"line_number":272,"context_line":"    if remainder[0] \u003d\u003d \u0027--\u0027:"},{"line_number":273,"context_line":"        remainder.pop(0)"},{"line_number":274,"context_line":"    sys.argv[1:] \u003d remainder"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba0121b8_b89e27b6","line":271,"range":{"start_line":271,"start_character":29,"end_line":271,"end_character":45},"updated":"2016-03-30 00:24:20.000000000","message":"I\u0027d rather see us using \u0027parse_args\u0027, if a user provides\nwsgi_app -- port 8080 --badarg -- --passed-arg 8888\nwe should error.\n\n\nI\u0027d also prefer like to see\nwsgi_app -- port 8080 badpos -- --passed-arg 8888\nwsgi_app -- port 8080 badpos --passed-arg 8888\nerror as well.  I don\u0027t see a way to make argparse do this nicely though, so may need to be done following argparse.\n\n\nTo use parse_args, rather than known_args, add an argument that globs the remainder nargs\u003dargparse.REMAINDER.","commit_id":"49f537f93beeb8b8ff19776fac5ef4f99ea7a57f"},{"author":{"_account_id":12612,"name":"Sachi King","email":"nakato@nakato.io","username":"nakato"},"change_message_id":"2617253b35b4a67552ad3d1aa8f4c12e996176df","unresolved":false,"context_lines":[{"line_number":269,"context_line":"    parser.add_argument(\u0027--port\u0027, \u0027-p\u0027, type\u003dint, default\u003d8000,"},{"line_number":270,"context_line":"                        help\u003d\u0027TCP port to listen on\u0027)"},{"line_number":271,"context_line":"    args, remainder \u003d parser.parse_known_args()"},{"line_number":272,"context_line":"    if remainder[0] \u003d\u003d \u0027--\u0027:"},{"line_number":273,"context_line":"        remainder.pop(0)"},{"line_number":274,"context_line":"    sys.argv[1:] \u003d remainder"},{"line_number":275,"context_line":"    server \u003d wss.make_server(\u0027\u0027, args.port, %(invoke_target)s())"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba0121b8_52deca6d","line":272,"updated":"2016-03-30 00:24:20.000000000","message":"If the remainder doesn\u0027t start with \u0027--\u0027 it\u0027s an error.  It means the user tried to pass positional arguments into this script and we should error.  Or worse, a named option that \u0027parse_known_args\u0027 did not know about.\n\nThis doesn\u0027t prevent passing -- into the next program with \u0027parse_known_args\u0027.\nwsgi_app -- port 8080 --badarg -- --passed-arg 8888\n[\u0027--badarg\u0027, \u0027--\u0027, \u0027--passed-arg\u0027, \u00278888\u0027]","commit_id":"49f537f93beeb8b8ff19776fac5ef4f99ea7a57f"},{"author":{"_account_id":12612,"name":"Sachi King","email":"nakato@nakato.io","username":"nakato"},"change_message_id":"2e466fd5dbdfb05760b5ae7da785dec52ab3391a","unresolved":false,"context_lines":[{"line_number":265,"context_line":"    parser \u003d argparse.ArgumentParser("},{"line_number":266,"context_line":"        description\u003d%(import_target)s.__doc__,"},{"line_number":267,"context_line":"        formatter_class\u003dargparse.ArgumentDefaultsHelpFormatter,"},{"line_number":268,"context_line":"        usage\u003d\u0027%%(prog)s [-h] [--port PORT] [-- [options]]\u0027)"},{"line_number":269,"context_line":"    parser.add_argument(\u0027--port\u0027, \u0027-p\u0027, type\u003dint, default\u003d8000,"},{"line_number":270,"context_line":"                        help\u003d\u0027TCP port to listen on\u0027)"},{"line_number":271,"context_line":"    parser.add_argument(\u0027args\u0027, nargs\u003dargparse.REMAINDER)"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba0121b8_36e0e6cc","line":268,"range":{"start_line":268,"start_character":49,"end_line":268,"end_character":56},"updated":"2016-04-01 01:46:16.000000000","message":"Nit:  I would like to see this be clearer that \"options\" are passed to the wsgi app.","commit_id":"fff8dc22c9277613c6b6ea8528184477218c84e1"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"f2e40f15fe3d9e092ed7c8f1364be1129a5e07d0","unresolved":false,"context_lines":[{"line_number":265,"context_line":"    parser \u003d argparse.ArgumentParser("},{"line_number":266,"context_line":"        description\u003d%(import_target)s.__doc__,"},{"line_number":267,"context_line":"        formatter_class\u003dargparse.ArgumentDefaultsHelpFormatter,"},{"line_number":268,"context_line":"        usage\u003d\u0027%%(prog)s [-h] [--port PORT] [-- [options]]\u0027)"},{"line_number":269,"context_line":"    parser.add_argument(\u0027--port\u0027, \u0027-p\u0027, type\u003dint, default\u003d8000,"},{"line_number":270,"context_line":"                        help\u003d\u0027TCP port to listen on\u0027)"},{"line_number":271,"context_line":"    parser.add_argument(\u0027args\u0027, nargs\u003dargparse.REMAINDER)"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba0121b8_80387ad4","line":268,"range":{"start_line":268,"start_character":49,"end_line":268,"end_character":56},"in_reply_to":"ba0121b8_36e0e6cc","updated":"2016-04-01 09:30:10.000000000","message":"How so?","commit_id":"fff8dc22c9277613c6b6ea8528184477218c84e1"},{"author":{"_account_id":12612,"name":"Sachi King","email":"nakato@nakato.io","username":"nakato"},"change_message_id":"3aebadbae28d14e4ef130940f4e5d4e2ad7eb932","unresolved":false,"context_lines":[{"line_number":265,"context_line":"    parser \u003d argparse.ArgumentParser("},{"line_number":266,"context_line":"        description\u003d%(import_target)s.__doc__,"},{"line_number":267,"context_line":"        formatter_class\u003dargparse.ArgumentDefaultsHelpFormatter,"},{"line_number":268,"context_line":"        usage\u003d\u0027%%(prog)s [-h] [--port PORT] [-- [options]]\u0027)"},{"line_number":269,"context_line":"    parser.add_argument(\u0027--port\u0027, \u0027-p\u0027, type\u003dint, default\u003d8000,"},{"line_number":270,"context_line":"                        help\u003d\u0027TCP port to listen on\u0027)"},{"line_number":271,"context_line":"    parser.add_argument(\u0027args\u0027, nargs\u003dargparse.REMAINDER)"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba0121b8_c1df14d4","line":268,"range":{"start_line":268,"start_character":49,"end_line":268,"end_character":56},"in_reply_to":"ba0121b8_80387ad4","updated":"2016-04-01 11:22:44.000000000","message":"\"passed options\" or \"passed args\" or the like","commit_id":"fff8dc22c9277613c6b6ea8528184477218c84e1"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"f315ef10eaf969e7a9d2151a8806e6164db1d314","unresolved":false,"context_lines":[{"line_number":265,"context_line":"    parser \u003d argparse.ArgumentParser("},{"line_number":266,"context_line":"        description\u003d%(import_target)s.__doc__,"},{"line_number":267,"context_line":"        formatter_class\u003dargparse.ArgumentDefaultsHelpFormatter,"},{"line_number":268,"context_line":"        usage\u003d\u0027%%(prog)s [-h] [--port PORT] [-- [options]]\u0027)"},{"line_number":269,"context_line":"    parser.add_argument(\u0027--port\u0027, \u0027-p\u0027, type\u003dint, default\u003d8000,"},{"line_number":270,"context_line":"                        help\u003d\u0027TCP port to listen on\u0027)"},{"line_number":271,"context_line":"    parser.add_argument(\u0027args\u0027, nargs\u003dargparse.REMAINDER)"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba0121b8_279b7d67","line":268,"range":{"start_line":268,"start_character":49,"end_line":268,"end_character":56},"in_reply_to":"ba0121b8_c1df14d4","updated":"2016-04-01 12:54:30.000000000","message":"Done","commit_id":"fff8dc22c9277613c6b6ea8528184477218c84e1"},{"author":{"_account_id":12612,"name":"Sachi King","email":"nakato@nakato.io","username":"nakato"},"change_message_id":"2e466fd5dbdfb05760b5ae7da785dec52ab3391a","unresolved":false,"context_lines":[{"line_number":268,"context_line":"        usage\u003d\u0027%%(prog)s [-h] [--port PORT] [-- [options]]\u0027)"},{"line_number":269,"context_line":"    parser.add_argument(\u0027--port\u0027, \u0027-p\u0027, type\u003dint, default\u003d8000,"},{"line_number":270,"context_line":"                        help\u003d\u0027TCP port to listen on\u0027)"},{"line_number":271,"context_line":"    parser.add_argument(\u0027args\u0027, nargs\u003dargparse.REMAINDER)"},{"line_number":272,"context_line":"    args \u003d parser.parse_args()"},{"line_number":273,"context_line":"    if args.args and args.args[0] \u003d\u003d \u0027--\u0027:"},{"line_number":274,"context_line":"        args.args.pop(0)"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba0121b8_76fd3e6d","line":271,"updated":"2016-04-01 01:46:16.000000000","message":"Nit: Maybe adding help to this argument could help address making it clear that the args are passed to the wsgi application as well as being explicit about the \u0027--\u0027","commit_id":"fff8dc22c9277613c6b6ea8528184477218c84e1"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"f2e40f15fe3d9e092ed7c8f1364be1129a5e07d0","unresolved":false,"context_lines":[{"line_number":268,"context_line":"        usage\u003d\u0027%%(prog)s [-h] [--port PORT] [-- [options]]\u0027)"},{"line_number":269,"context_line":"    parser.add_argument(\u0027--port\u0027, \u0027-p\u0027, type\u003dint, default\u003d8000,"},{"line_number":270,"context_line":"                        help\u003d\u0027TCP port to listen on\u0027)"},{"line_number":271,"context_line":"    parser.add_argument(\u0027args\u0027, nargs\u003dargparse.REMAINDER)"},{"line_number":272,"context_line":"    args \u003d parser.parse_args()"},{"line_number":273,"context_line":"    if args.args and args.args[0] \u003d\u003d \u0027--\u0027:"},{"line_number":274,"context_line":"        args.args.pop(0)"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba0121b8_e06176d4","line":271,"in_reply_to":"ba0121b8_76fd3e6d","updated":"2016-04-01 09:30:10.000000000","message":"Nop, try it, you\u0027ll see that it does not work out. The metavar for REMAINDER is always \"...\".\nGood luck with guessing that ... means \"passed to the WSGI app\"","commit_id":"fff8dc22c9277613c6b6ea8528184477218c84e1"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"f315ef10eaf969e7a9d2151a8806e6164db1d314","unresolved":false,"context_lines":[{"line_number":268,"context_line":"        usage\u003d\u0027%%(prog)s [-h] [--port PORT] [-- [options]]\u0027)"},{"line_number":269,"context_line":"    parser.add_argument(\u0027--port\u0027, \u0027-p\u0027, type\u003dint, default\u003d8000,"},{"line_number":270,"context_line":"                        help\u003d\u0027TCP port to listen on\u0027)"},{"line_number":271,"context_line":"    parser.add_argument(\u0027args\u0027, nargs\u003dargparse.REMAINDER)"},{"line_number":272,"context_line":"    args \u003d parser.parse_args()"},{"line_number":273,"context_line":"    if args.args and args.args[0] \u003d\u003d \u0027--\u0027:"},{"line_number":274,"context_line":"        args.args.pop(0)"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba0121b8_07e0f9cb","line":271,"in_reply_to":"ba0121b8_b33353f5","updated":"2016-04-01 12:54:30.000000000","message":"As I said, metavar is not used in the case of REMAINDER in the help message. Try it you\u0027ll see :(","commit_id":"fff8dc22c9277613c6b6ea8528184477218c84e1"},{"author":{"_account_id":12612,"name":"Sachi King","email":"nakato@nakato.io","username":"nakato"},"change_message_id":"3aebadbae28d14e4ef130940f4e5d4e2ad7eb932","unresolved":false,"context_lines":[{"line_number":268,"context_line":"        usage\u003d\u0027%%(prog)s [-h] [--port PORT] [-- [options]]\u0027)"},{"line_number":269,"context_line":"    parser.add_argument(\u0027--port\u0027, \u0027-p\u0027, type\u003dint, default\u003d8000,"},{"line_number":270,"context_line":"                        help\u003d\u0027TCP port to listen on\u0027)"},{"line_number":271,"context_line":"    parser.add_argument(\u0027args\u0027, nargs\u003dargparse.REMAINDER)"},{"line_number":272,"context_line":"    args \u003d parser.parse_args()"},{"line_number":273,"context_line":"    if args.args and args.args[0] \u003d\u003d \u0027--\u0027:"},{"line_number":274,"context_line":"        args.args.pop(0)"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba0121b8_b33353f5","line":271,"in_reply_to":"ba0121b8_e06176d4","updated":"2016-04-01 11:22:44.000000000","message":"Yes, this won\u0027t change the usage line, sorry I wasn\u0027t clear on this.  I was thinking that by modifying the help line here we can reinforce the usage line and make it clear to end users what is happening rather than expecting that the user possess some prior knowledge of what \u0027-- [opts]\u0027 usually means in command lines, or guessing what it means based on our usage line without further details.\n\nSomething similar to the following could provide this.\n\nmetavar\u003d\u0027-- [passed args]\u0027, help\u003d\"\u0027--\u0027 is the separator of the arguments used to start the wsgi server and the arguments passed to the wsgi application.\")","commit_id":"fff8dc22c9277613c6b6ea8528184477218c84e1"},{"author":{"_account_id":12612,"name":"Sachi King","email":"nakato@nakato.io","username":"nakato"},"change_message_id":"2e466fd5dbdfb05760b5ae7da785dec52ab3391a","unresolved":false,"context_lines":[{"line_number":269,"context_line":"    parser.add_argument(\u0027--port\u0027, \u0027-p\u0027, type\u003dint, default\u003d8000,"},{"line_number":270,"context_line":"                        help\u003d\u0027TCP port to listen on\u0027)"},{"line_number":271,"context_line":"    parser.add_argument(\u0027args\u0027, nargs\u003dargparse.REMAINDER)"},{"line_number":272,"context_line":"    args \u003d parser.parse_args()"},{"line_number":273,"context_line":"    if args.args and args.args[0] \u003d\u003d \u0027--\u0027:"},{"line_number":274,"context_line":"        args.args.pop(0)"},{"line_number":275,"context_line":"    sys.argv[1:] \u003d args.args"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba0121b8_d6708a42","line":272,"updated":"2016-04-01 01:46:16.000000000","message":"Parser looks good now, thanks!","commit_id":"fff8dc22c9277613c6b6ea8528184477218c84e1"},{"author":{"_account_id":12612,"name":"Sachi King","email":"nakato@nakato.io","username":"nakato"},"change_message_id":"2e466fd5dbdfb05760b5ae7da785dec52ab3391a","unresolved":false,"context_lines":[{"line_number":270,"context_line":"                        help\u003d\u0027TCP port to listen on\u0027)"},{"line_number":271,"context_line":"    parser.add_argument(\u0027args\u0027, nargs\u003dargparse.REMAINDER)"},{"line_number":272,"context_line":"    args \u003d parser.parse_args()"},{"line_number":273,"context_line":"    if args.args and args.args[0] \u003d\u003d \u0027--\u0027:"},{"line_number":274,"context_line":"        args.args.pop(0)"},{"line_number":275,"context_line":"    sys.argv[1:] \u003d args.args"},{"line_number":276,"context_line":"    server \u003d wss.make_server(\u0027\u0027, args.port, %(invoke_target)s())"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba0121b8_319e30b9","line":273,"updated":"2016-04-01 01:46:16.000000000","message":"We need to be more strict than this.\nIf we have args, and they do not start with \u0027--\u0027, we should error, print usage, and exit 2.\n\n\n\nI\u0027ve two concerns that lead me to this preference:\n\n1: If it works now, we\u0027ll have to maintain that functionality forever.  As such we need to make sure our format is explicit from the get go, as we really can\u0027t change it going forward.\n\n2: Catching user error and not introducing unexpected behaviour via allowing weakly parsed command lines to be passed.  We must explicit.\n\n\n\nwsgi_app --port 8080 posArg --passedArg arg passedPosArg\nwsgi_app foo --port 8080 -- ...\nShould both error\n\nwsgi_app --port 8080 --\nwsgi_app --\nwsgi_app -- --arg a\nwsgi_app -- posarg\nwsgi_app -- --PassedArg a -- --more args\nShould all work\n\nwsgi_app [--port $PORTNUM] [-- [passed_args]]","commit_id":"fff8dc22c9277613c6b6ea8528184477218c84e1"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"f2e40f15fe3d9e092ed7c8f1364be1129a5e07d0","unresolved":false,"context_lines":[{"line_number":270,"context_line":"                        help\u003d\u0027TCP port to listen on\u0027)"},{"line_number":271,"context_line":"    parser.add_argument(\u0027args\u0027, nargs\u003dargparse.REMAINDER)"},{"line_number":272,"context_line":"    args \u003d parser.parse_args()"},{"line_number":273,"context_line":"    if args.args and args.args[0] \u003d\u003d \u0027--\u0027:"},{"line_number":274,"context_line":"        args.args.pop(0)"},{"line_number":275,"context_line":"    sys.argv[1:] \u003d args.args"},{"line_number":276,"context_line":"    server \u003d wss.make_server(\u0027\u0027, args.port, %(invoke_target)s())"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba0121b8_80ad1aeb","line":273,"in_reply_to":"ba0121b8_319e30b9","updated":"2016-04-01 09:30:10.000000000","message":"\"If we have args, and they do not start with \u0027--\u0027, we should error, print usage, and exit 2.\"\n\nThis is what happens.","commit_id":"fff8dc22c9277613c6b6ea8528184477218c84e1"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"31765fc220c2ec71e6dd88c0a3396dbbe61d6004","unresolved":false,"context_lines":[{"line_number":270,"context_line":"                        help\u003d\u0027TCP port to listen on\u0027)"},{"line_number":271,"context_line":"    parser.add_argument(\u0027args\u0027, nargs\u003dargparse.REMAINDER)"},{"line_number":272,"context_line":"    args \u003d parser.parse_args()"},{"line_number":273,"context_line":"    if args.args and args.args[0] \u003d\u003d \u0027--\u0027:"},{"line_number":274,"context_line":"        args.args.pop(0)"},{"line_number":275,"context_line":"    sys.argv[1:] \u003d args.args"},{"line_number":276,"context_line":"    server \u003d wss.make_server(\u0027\u0027, args.port, %(invoke_target)s())"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba0121b8_8cd550e6","line":273,"in_reply_to":"ba0121b8_319e30b9","updated":"2016-04-01 12:29:00.000000000","message":"Running the script is clearly marked as for developer testing only and not for production. We don\u0027t need to support functionality in here forever.","commit_id":"fff8dc22c9277613c6b6ea8528184477218c84e1"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"f315ef10eaf969e7a9d2151a8806e6164db1d314","unresolved":false,"context_lines":[{"line_number":270,"context_line":"                        help\u003d\u0027TCP port to listen on\u0027)"},{"line_number":271,"context_line":"    parser.add_argument(\u0027args\u0027, nargs\u003dargparse.REMAINDER)"},{"line_number":272,"context_line":"    args \u003d parser.parse_args()"},{"line_number":273,"context_line":"    if args.args and args.args[0] \u003d\u003d \u0027--\u0027:"},{"line_number":274,"context_line":"        args.args.pop(0)"},{"line_number":275,"context_line":"    sys.argv[1:] \u003d args.args"},{"line_number":276,"context_line":"    server \u003d wss.make_server(\u0027\u0027, args.port, %(invoke_target)s())"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba0121b8_e77ea5e2","line":273,"in_reply_to":"ba0121b8_33aaa385","updated":"2016-04-01 12:54:30.000000000","message":"All your examples here are working correctly to me, this is what\u0027s expected when using remainder the way we do.\n\nI just notice that if the argument is \"foobar\" rather than \"--foobar\" then the \"--\" to separate both args is not required. I changed the usage line in this regard.\n\n\nThis is clearly the best we can do. I\u0027ve worked with Thomas to find the best trade-offs here, but a magical solution that does everything is not going to work unfortunately. Call that a limitation of argparse.","commit_id":"fff8dc22c9277613c6b6ea8528184477218c84e1"},{"author":{"_account_id":12612,"name":"Sachi King","email":"nakato@nakato.io","username":"nakato"},"change_message_id":"3aebadbae28d14e4ef130940f4e5d4e2ad7eb932","unresolved":false,"context_lines":[{"line_number":270,"context_line":"                        help\u003d\u0027TCP port to listen on\u0027)"},{"line_number":271,"context_line":"    parser.add_argument(\u0027args\u0027, nargs\u003dargparse.REMAINDER)"},{"line_number":272,"context_line":"    args \u003d parser.parse_args()"},{"line_number":273,"context_line":"    if args.args and args.args[0] \u003d\u003d \u0027--\u0027:"},{"line_number":274,"context_line":"        args.args.pop(0)"},{"line_number":275,"context_line":"    sys.argv[1:] \u003d args.args"},{"line_number":276,"context_line":"    server \u003d wss.make_server(\u0027\u0027, args.port, %(invoke_target)s())"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba0121b8_33aaa385","line":273,"in_reply_to":"ba0121b8_80ad1aeb","updated":"2016-04-01 11:22:44.000000000","message":"My testing shows that this indeed gets passed to the WSGI application, which is likely then breaking.  This should error in this script, not in the application in which we are calling.\n\n\n\nWSGI Script usage/breakage:\n% keystone-wsgi-public --badarg\nusage: keystone-wsgi-public [-h] [--port PORT] [-- [options]]\nkeystone-wsgi-public: error: unrecognized arguments: --badarg\n\n\nKeystone application usage/breakage:\n% keystone-wsgi-public -- --badarg\nusage: keystone-wsgi-public [-h] [--config-dir DIR] [--config-file PATH]\n                            [--debug] [--log-config-append PATH]\n                            [--log-date-format DATE_FORMAT]\n                            [--log-dir LOG_DIR] [--log-file PATH] [--nodebug]\n                            [--nostandard-threads] [--nouse-syslog]\n                            [--noverbose] [--nowatch-log-file]\n                            [--pydev-debug-host PYDEV_DEBUG_HOST]\n                            [--pydev-debug-port PYDEV_DEBUG_PORT]\n                            [--standard-threads]\n                            [--syslog-log-facility SYSLOG_LOG_FACILITY]\n                            [--use-syslog] [--verbose] [--version]\n                            [--watch-log-file]\nkeystone-wsgi-public: error: unrecognized arguments: --badarg\n\n\nBad command line passed to WSGI script results in wsgi application returning the error, not the WSGI script.\n% keystone-wsgi-public badPosArg --use-syslog\nusage: keystone-wsgi-public [-h] [--config-dir DIR] [--config-file PATH]\n                            [--debug] [--log-config-append PATH]\n                            [--log-date-format DATE_FORMAT]\n                            [--log-dir LOG_DIR] [--log-file PATH] [--nodebug]\n                            [--nostandard-threads] [--nouse-syslog]\n                            [--noverbose] [--nowatch-log-file]\n                            [--pydev-debug-host PYDEV_DEBUG_HOST]\n                            [--pydev-debug-port PYDEV_DEBUG_PORT]\n                            [--standard-threads]\n                            [--syslog-log-facility SYSLOG_LOG_FACILITY]\n                            [--use-syslog] [--verbose] [--version]\n                            [--watch-log-file]\nkeystone-wsgi-public: error: unrecognized arguments: badPosArg\n\n\nAnd the same in this format:\n% keystone-wsgi-public badPosArg -- --use-syslog\nusage: keystone-wsgi-public [-h] [--config-dir DIR] [--config-file PATH]","commit_id":"fff8dc22c9277613c6b6ea8528184477218c84e1"},{"author":{"_account_id":12612,"name":"Sachi King","email":"nakato@nakato.io","username":"nakato"},"change_message_id":"ea965265f3187b07b7a8098ec43dca932c9822bc","unresolved":false,"context_lines":[{"line_number":268,"context_line":"        usage\u003d\u0027%%(prog)s [-h] [--port PORT] [--] [passed options]\u0027)"},{"line_number":269,"context_line":"    parser.add_argument(\u0027--port\u0027, \u0027-p\u0027, type\u003dint, default\u003d8000,"},{"line_number":270,"context_line":"                        help\u003d\u0027TCP port to listen on\u0027)"},{"line_number":271,"context_line":"    parser.add_argument(\u0027args\u0027, nargs\u003dargparse.REMAINDER)"},{"line_number":272,"context_line":"    args \u003d parser.parse_args()"},{"line_number":273,"context_line":"    if args.args and args.args[0] \u003d\u003d \u0027--\u0027:"},{"line_number":274,"context_line":"        args.args.pop(0)"}],"source_content_type":"text/x-python","patch_set":9,"id":"ba0121b8_8aa22d99","line":271,"range":{"start_line":271,"start_character":4,"end_line":271,"end_character":57},"updated":"2016-04-02 13:13:22.000000000","message":"\u003e As I said, metavar is not used in the case of REMAINDER in the help message. Try it you\u0027ll see :(\n\nAs I said, sorry for not being clear, I was not meaning to modify the usage line.\n\nJust having a usage line is not beneficial for a user that doesn\u0027t already possess background knowledge as to what that means.  By modifying this a helpful help message can be generated when a user calls \u0027--help\u0027.  Please take a moment to reread the comment in patchset 8, and comment if something is not clear, I\u0027ll attempt to clear it up.","commit_id":"79621856f3b190d9f7a648e026d752517aa68b44"},{"author":{"_account_id":12612,"name":"Sachi King","email":"nakato@nakato.io","username":"nakato"},"change_message_id":"ea965265f3187b07b7a8098ec43dca932c9822bc","unresolved":false,"context_lines":[{"line_number":270,"context_line":"                        help\u003d\u0027TCP port to listen on\u0027)"},{"line_number":271,"context_line":"    parser.add_argument(\u0027args\u0027, nargs\u003dargparse.REMAINDER)"},{"line_number":272,"context_line":"    args \u003d parser.parse_args()"},{"line_number":273,"context_line":"    if args.args and args.args[0] \u003d\u003d \u0027--\u0027:"},{"line_number":274,"context_line":"        args.args.pop(0)"},{"line_number":275,"context_line":"    sys.argv[1:] \u003d args.args"},{"line_number":276,"context_line":"    server \u003d wss.make_server(\u0027\u0027, args.port, %(invoke_target)s())"}],"source_content_type":"text/x-python","patch_set":9,"id":"ba0121b8_2ad5e1b8","line":273,"range":{"start_line":273,"start_character":4,"end_line":273,"end_character":42},"updated":"2016-04-02 13:13:22.000000000","message":"They are not working correctly, note that it is the downstream application throwing an error on bad input that this script should be catching.  This script cares about everything before the first \u0027--\u0027 argument, everything after it is not our problem.  If we ever pass anything before the first \u0027--\u0027 that is on us.  This is important as not all downstream applications will interpret arguments the same, and thus we can\u0027t expect them to handle an error for us.  As well printing the wrong usage line for apps that do catch it as an error leaves the user with incorrect information as this says the error is in the passed args, not in the args we telling the user we are parsing in this script, increasing the difficulty of debugging the issue.\n\nNo, it is not doable in argparse, but stripping the \u0027--\u0027 isn\u0027t either, yet we are handling that.  We are fully capable of validating the contents of the args.args list before we continue, and if it does not validate, as in we have anything before the first --, we can call parser.error with a message that makes since.\n\nif args.args:\n    if args.args[0] !\u003d \u0027--\u0027:\n        # Copied from argparse\n        msg \u003d \u0027unrecognized arguments: %s\u0027\n        parser.error(msg % \u0027\u0027.join(args.args)\n    else:\n        args.args.pop(0)","commit_id":"79621856f3b190d9f7a648e026d752517aa68b44"},{"author":{"_account_id":12612,"name":"Sachi King","email":"nakato@nakato.io","username":"nakato"},"change_message_id":"ea965265f3187b07b7a8098ec43dca932c9822bc","unresolved":false,"context_lines":[{"line_number":279,"context_line":"    print(\"STARTING test server %(module_name)s.%(invoke_target)s\")"},{"line_number":280,"context_line":"    url \u003d \"http://%%s:%%d/\" %% (my_ip, server.server_port)"},{"line_number":281,"context_line":"    print(\"Available at %%s\" %% url)"},{"line_number":282,"context_line":"    print(\"DANGER! For testing only, do not use in production\")"},{"line_number":283,"context_line":"    print(\"*\" * 80)"},{"line_number":284,"context_line":""},{"line_number":285,"context_line":"    server.serve_forever()"}],"source_content_type":"text/x-python","patch_set":9,"id":"ba0121b8_0ab57dcf","line":282,"range":{"start_line":282,"start_character":11,"end_line":282,"end_character":61},"updated":"2016-04-02 13:13:22.000000000","message":"\u003e Running the script is clearly marked as for developer testing only and not for production. We don\u0027t need to support functionality in here forever.\n\nThis script may not be safe to provide a production ready wsgi server to serve downstream applications, but this script is a production application.  It may be used in downstream CI servers, developer tox commands, or other development testing scripts, and as far as I am concerned that is production.  We cannot weaken our contract to do our absolute best in not breaking downstream, just because it would only break someone\u0027s CI system.","commit_id":"79621856f3b190d9f7a648e026d752517aa68b44"},{"author":{"_account_id":4190,"name":"lifeless","email":"robertc@robertcollins.net","username":"lifeless"},"change_message_id":"243ed93e289afa7b3ae12aaac70a345b2bafe80b","unresolved":false,"context_lines":[{"line_number":280,"context_line":"            args.args.pop(0)"},{"line_number":281,"context_line":"        else:"},{"line_number":282,"context_line":"            parser.error(\"unrecognized arguments: %%s\" %% \u0027 \u0027.join(args.args))"},{"line_number":283,"context_line":"    sys.argv[1:] \u003d args.args"},{"line_number":284,"context_line":"    server \u003d wss.make_server(\u0027\u0027, args.port, %(invoke_target)s())"},{"line_number":285,"context_line":""},{"line_number":286,"context_line":"    print(\"*\" * 80)"}],"source_content_type":"text/x-python","patch_set":11,"id":"9a061dce_751f1a08","line":283,"updated":"2016-04-07 00:10:58.000000000","message":"This seems unfortunate: it would be better to have the entry points we call accept an args vector. That would be a separate change, but I\u0027ve love it if someone did that.","commit_id":"36b794260d5368161cb8c8b4e98eb3c40463a0ae"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"55323653de20fe45913705862592ef965c15947b","unresolved":false,"context_lines":[{"line_number":252,"context_line":""},{"line_number":253,"context_line":"_wsgi_text \u003d \"\"\"#PBR Generated from %(group)r"},{"line_number":254,"context_line":""},{"line_number":255,"context_line":"import sys"},{"line_number":256,"context_line":"import threading"},{"line_number":257,"context_line":""},{"line_number":258,"context_line":"from %(module_name)s import %(import_target)s"}],"source_content_type":"text/x-python","patch_set":13,"id":"5a18252c_1ee52ddb","line":255,"updated":"2016-04-14 14:46:49.000000000","message":"sys is imported at line 263 already.","commit_id":"2dfa3137d433c328446dce0ba80b0a37b72d3a75"},{"author":{"_account_id":7385,"name":"Thomas Herve","email":"therve@redhat.com","username":"therve"},"change_message_id":"bb97bad38767cf5267dc57d5b62c3719f73b89d1","unresolved":false,"context_lines":[{"line_number":252,"context_line":""},{"line_number":253,"context_line":"_wsgi_text \u003d \"\"\"#PBR Generated from %(group)r"},{"line_number":254,"context_line":""},{"line_number":255,"context_line":"import sys"},{"line_number":256,"context_line":"import threading"},{"line_number":257,"context_line":""},{"line_number":258,"context_line":"from %(module_name)s import %(import_target)s"}],"source_content_type":"text/x-python","patch_set":13,"id":"5a18252c_320e5d3b","line":255,"in_reply_to":"5a18252c_1ee52ddb","updated":"2016-04-14 14:58:40.000000000","message":"Done","commit_id":"2dfa3137d433c328446dce0ba80b0a37b72d3a75"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"5161e6722467457b0caa684e27104c8c72a7d284","unresolved":false,"context_lines":[{"line_number":252,"context_line":""},{"line_number":253,"context_line":"_wsgi_text \u003d \"\"\"#PBR Generated from %(group)r"},{"line_number":254,"context_line":""},{"line_number":255,"context_line":"import sys"},{"line_number":256,"context_line":"import threading"},{"line_number":257,"context_line":""},{"line_number":258,"context_line":"from %(module_name)s import %(import_target)s"}],"source_content_type":"text/x-python","patch_set":14,"id":"5a18252c_d58553cf","line":255,"updated":"2016-04-14 15:08:16.000000000","message":"not sure about this move but well","commit_id":"7077beb8efd2c7331978c54349469a154b3d6c97"}],"pbr/tests/test_wsgi.py":[{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"8cbf0ffa32cf0589fbb2b23e8301c7a4e24c45a1","unresolved":false,"context_lines":[{"line_number":35,"context_line":"    cmd_names \u003d (\u0027pbr_test_wsgi\u0027, \u0027pbr_test_wsgi_with_class\u0027)"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    def _add_path(self):"},{"line_number":38,"context_line":"        if os.path.isdir(\"%s/lib64\" % self.temp_dir):"},{"line_number":39,"context_line":"            path \u003d \"%s/lib64\" % self.temp_dir"},{"line_number":40,"context_line":"        else:"},{"line_number":41,"context_line":"            path \u003d \"%s/lib\" % self.temp_dir"}],"source_content_type":"text/x-python","patch_set":12,"id":"5a18252c_01923657","line":38,"updated":"2016-04-13 13:58:19.000000000","message":"this change looks unrelated... Reasons for changes should be mentioned in the commit message.","commit_id":"4293f7181a5650ee694ae4376c2a052dde7c0e2c"},{"author":{"_account_id":7385,"name":"Thomas Herve","email":"therve@redhat.com","username":"therve"},"change_message_id":"c04bca9e2b17f4d05de305746d3933923f70f0ee","unresolved":false,"context_lines":[{"line_number":35,"context_line":"    cmd_names \u003d (\u0027pbr_test_wsgi\u0027, \u0027pbr_test_wsgi_with_class\u0027)"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    def _add_path(self):"},{"line_number":38,"context_line":"        if os.path.isdir(\"%s/lib64\" % self.temp_dir):"},{"line_number":39,"context_line":"            path \u003d \"%s/lib64\" % self.temp_dir"},{"line_number":40,"context_line":"        else:"},{"line_number":41,"context_line":"            path \u003d \"%s/lib\" % self.temp_dir"}],"source_content_type":"text/x-python","patch_set":12,"id":"5a18252c_8a2adb7c","line":38,"in_reply_to":"5a18252c_01923657","updated":"2016-04-13 14:25:03.000000000","message":"It\u0027s in the tests though. That doesn\u0027t run. Not sure how relevant it is. I had to make it because my distro puts python files in lib64, and the test was failing.","commit_id":"4293f7181a5650ee694ae4376c2a052dde7c0e2c"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"7e4eefe20cb6c772ed401632de6caf55485e21ce","unresolved":false,"context_lines":[{"line_number":112,"context_line":""},{"line_number":113,"context_line":"        # the sleep is important to force a context switch to the"},{"line_number":114,"context_line":"        # subprocess"},{"line_number":115,"context_line":"        time.sleep(1.0)"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"        stdoutdata \u003d stdout.read()"},{"line_number":118,"context_line":"        self.assertIn("}],"source_content_type":"text/x-python","patch_set":12,"id":"7a1b2928_2487d010","line":115,"updated":"2016-04-11 09:24:37.000000000","message":"Really needed? :/","commit_id":"4293f7181a5650ee694ae4376c2a052dde7c0e2c"},{"author":{"_account_id":7385,"name":"Thomas Herve","email":"therve@redhat.com","username":"therve"},"change_message_id":"c04bca9e2b17f4d05de305746d3933923f70f0ee","unresolved":false,"context_lines":[{"line_number":112,"context_line":""},{"line_number":113,"context_line":"        # the sleep is important to force a context switch to the"},{"line_number":114,"context_line":"        # subprocess"},{"line_number":115,"context_line":"        time.sleep(1.0)"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"        stdoutdata \u003d stdout.read()"},{"line_number":118,"context_line":"        self.assertIn("}],"source_content_type":"text/x-python","patch_set":12,"id":"5a18252c_6a365fe7","line":115,"in_reply_to":"5a18252c_013cf62d","updated":"2016-04-13 14:25:03.000000000","message":"I have a following patch that tries to reorganize the tests. I can revert that if you want, as it doesn\u0027t run anyway.","commit_id":"4293f7181a5650ee694ae4376c2a052dde7c0e2c"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"8cbf0ffa32cf0589fbb2b23e8301c7a4e24c45a1","unresolved":false,"context_lines":[{"line_number":112,"context_line":""},{"line_number":113,"context_line":"        # the sleep is important to force a context switch to the"},{"line_number":114,"context_line":"        # subprocess"},{"line_number":115,"context_line":"        time.sleep(1.0)"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"        stdoutdata \u003d stdout.read()"},{"line_number":118,"context_line":"        self.assertIn("}],"source_content_type":"text/x-python","patch_set":12,"id":"5a18252c_013cf62d","line":115,"in_reply_to":"7a1b2928_2487d010","updated":"2016-04-13 13:58:19.000000000","message":"this is strange and needs a comment. A short sleep makes some sense for convenience but a 1 second sleep needs an explanation.\n\nLooks like it\u0027s waiting for the output of the program to be available, and not actually about context switching at all.","commit_id":"4293f7181a5650ee694ae4376c2a052dde7c0e2c"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"8cbf0ffa32cf0589fbb2b23e8301c7a4e24c45a1","unresolved":false,"context_lines":[{"line_number":177,"context_line":"                      \"way to capture subprocess stdout without blocking\")"},{"line_number":178,"context_line":""},{"line_number":179,"context_line":"        if os.name \u003d\u003d \u0027nt\u0027:"},{"line_number":180,"context_line":"            self.skipTest(\u0027Windows support is passthrough\u0027)"},{"line_number":181,"context_line":""},{"line_number":182,"context_line":"        stdout, _, return_code \u003d self.run_setup("},{"line_number":183,"context_line":"            \u0027install\u0027, \u0027--prefix\u003d%s\u0027 % self.temp_dir)"}],"source_content_type":"text/x-python","patch_set":12,"id":"5a18252c_a42710b5","line":180,"updated":"2016-04-13 13:58:19.000000000","message":"not sure what it means for support to be passthrough?","commit_id":"4293f7181a5650ee694ae4376c2a052dde7c0e2c"},{"author":{"_account_id":7385,"name":"Thomas Herve","email":"therve@redhat.com","username":"therve"},"change_message_id":"c04bca9e2b17f4d05de305746d3933923f70f0ee","unresolved":false,"context_lines":[{"line_number":177,"context_line":"                      \"way to capture subprocess stdout without blocking\")"},{"line_number":178,"context_line":""},{"line_number":179,"context_line":"        if os.name \u003d\u003d \u0027nt\u0027:"},{"line_number":180,"context_line":"            self.skipTest(\u0027Windows support is passthrough\u0027)"},{"line_number":181,"context_line":""},{"line_number":182,"context_line":"        stdout, _, return_code \u003d self.run_setup("},{"line_number":183,"context_line":"            \u0027install\u0027, \u0027--prefix\u003d%s\u0027 % self.temp_dir)"}],"source_content_type":"text/x-python","patch_set":12,"id":"5a18252c_8a865b63","line":180,"in_reply_to":"5a18252c_a42710b5","updated":"2016-04-13 14:25:03.000000000","message":"I copied the original message.","commit_id":"4293f7181a5650ee694ae4376c2a052dde7c0e2c"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"55323653de20fe45913705862592ef965c15947b","unresolved":false,"context_lines":[{"line_number":79,"context_line":"            popen_cmd.extend(extra_args)"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"        env \u003d {\u0027PYTHONPATH\u0027: self._get_path(),"},{"line_number":82,"context_line":"               \u0027PYTHONUNBUFFERED\u0027: \u00271\u0027}"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"        p \u003d subprocess.Popen(popen_cmd, stdout\u003dsubprocess.PIPE,"},{"line_number":85,"context_line":"                             stderr\u003dsubprocess.PIPE, cwd\u003dself.temp_dir,"}],"source_content_type":"text/x-python","patch_set":13,"id":"5a18252c_9ef01d93","line":82,"updated":"2016-04-14 14:46:49.000000000","message":"no need to set PYTHONUNBUFFERED. Running application isn\u0027t going to have this so the tests shouldn\u0027t require it.","commit_id":"2dfa3137d433c328446dce0ba80b0a37b72d3a75"},{"author":{"_account_id":7385,"name":"Thomas Herve","email":"therve@redhat.com","username":"therve"},"change_message_id":"bb97bad38767cf5267dc57d5b62c3719f73b89d1","unresolved":false,"context_lines":[{"line_number":79,"context_line":"            popen_cmd.extend(extra_args)"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"        env \u003d {\u0027PYTHONPATH\u0027: self._get_path(),"},{"line_number":82,"context_line":"               \u0027PYTHONUNBUFFERED\u0027: \u00271\u0027}"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"        p \u003d subprocess.Popen(popen_cmd, stdout\u003dsubprocess.PIPE,"},{"line_number":85,"context_line":"                             stderr\u003dsubprocess.PIPE, cwd\u003dself.temp_dir,"}],"source_content_type":"text/x-python","patch_set":13,"id":"5a18252c_b2326d0e","line":82,"in_reply_to":"5a18252c_9ef01d93","updated":"2016-04-14 14:58:40.000000000","message":"Done","commit_id":"2dfa3137d433c328446dce0ba80b0a37b72d3a75"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"55323653de20fe45913705862592ef965c15947b","unresolved":false,"context_lines":[{"line_number":150,"context_line":"            self.assertIn(else_block, script_txt)"},{"line_number":151,"context_line":""},{"line_number":152,"context_line":"    def test_with_argument(self):"},{"line_number":153,"context_line":"        self.skipTest(\"Test skipped until we can determine a reliable \""},{"line_number":154,"context_line":"                      \"way to capture subprocess stdout without blocking\")"},{"line_number":155,"context_line":""},{"line_number":156,"context_line":"        if os.name \u003d\u003d \u0027nt\u0027:"}],"source_content_type":"text/x-python","patch_set":13,"id":"5a18252c_7e538139","line":153,"updated":"2016-04-14 14:46:49.000000000","message":"no need to skip this test since we\u0027ve got a reliable way to capture subprocess stdout (it uses pipe to communicate with the subprocess)","commit_id":"2dfa3137d433c328446dce0ba80b0a37b72d3a75"},{"author":{"_account_id":7385,"name":"Thomas Herve","email":"therve@redhat.com","username":"therve"},"change_message_id":"bb97bad38767cf5267dc57d5b62c3719f73b89d1","unresolved":false,"context_lines":[{"line_number":150,"context_line":"            self.assertIn(else_block, script_txt)"},{"line_number":151,"context_line":""},{"line_number":152,"context_line":"    def test_with_argument(self):"},{"line_number":153,"context_line":"        self.skipTest(\"Test skipped until we can determine a reliable \""},{"line_number":154,"context_line":"                      \"way to capture subprocess stdout without blocking\")"},{"line_number":155,"context_line":""},{"line_number":156,"context_line":"        if os.name \u003d\u003d \u0027nt\u0027:"}],"source_content_type":"text/x-python","patch_set":13,"id":"5a18252c_522af990","line":153,"in_reply_to":"5a18252c_7e538139","updated":"2016-04-14 14:58:40.000000000","message":"Done","commit_id":"2dfa3137d433c328446dce0ba80b0a37b72d3a75"}],"pbr/tests/testpackage/pbr_testpackage/wsgi.py":[{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"55323653de20fe45913705862592ef965c15947b","unresolved":false,"context_lines":[{"line_number":28,"context_line":"def main():"},{"line_number":29,"context_line":"    parser \u003d argparse.ArgumentParser(description\u003d\u0027Return a string.\u0027)"},{"line_number":30,"context_line":"    parser.add_argument(\u0027--content\u0027, \u0027-c\u0027, help\u003d\u0027String returned\u0027,"},{"line_number":31,"context_line":"                        default\u003db\u0027Hello World\u0027)"},{"line_number":32,"context_line":"    args \u003d parser.parse_args()"},{"line_number":33,"context_line":"    return functools.partial(application, data\u003dargs.content)"},{"line_number":34,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"5a18252c_723295f3","line":31,"updated":"2016-04-14 14:46:49.000000000","message":"I think it makes more sense to have the default be text and have application() do data.encode(\u0027utf-8\u0027) at line 25.\n\nIsn\u0027t the args.content going to be text and not binary if I pass --content?","commit_id":"2dfa3137d433c328446dce0ba80b0a37b72d3a75"},{"author":{"_account_id":7385,"name":"Thomas Herve","email":"therve@redhat.com","username":"therve"},"change_message_id":"bb97bad38767cf5267dc57d5b62c3719f73b89d1","unresolved":false,"context_lines":[{"line_number":28,"context_line":"def main():"},{"line_number":29,"context_line":"    parser \u003d argparse.ArgumentParser(description\u003d\u0027Return a string.\u0027)"},{"line_number":30,"context_line":"    parser.add_argument(\u0027--content\u0027, \u0027-c\u0027, help\u003d\u0027String returned\u0027,"},{"line_number":31,"context_line":"                        default\u003db\u0027Hello World\u0027)"},{"line_number":32,"context_line":"    args \u003d parser.parse_args()"},{"line_number":33,"context_line":"    return functools.partial(application, data\u003dargs.content)"},{"line_number":34,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"5a18252c_7256152b","line":31,"in_reply_to":"5a18252c_723295f3","updated":"2016-04-14 14:58:40.000000000","message":"Done","commit_id":"2dfa3137d433c328446dce0ba80b0a37b72d3a75"}]}
