[PATCH 1 of 1] changeset: don't crash on malformed whitespace parameter

Mads Kiilerich mads at kiilerich.com
Fri Mar 6 09:38:58 EST 2015


On 02/26/2015 04:50 PM, Andrew Shadura wrote:
> # HG changeset patch
> # User Andrew Shadura <andrew at shadura.me>
> # Date 1424965487 -3600
> #      Thu Feb 26 16:44:47 2015 +0100
> # Node ID ec1aa401f1e2e25a0f4b43b7dddba12e11d96f17
> # Parent  c583bfc8785b96436e193aa1e2acc2820e436c7c
> changeset: don't crash on malformed whitespace parameter
>
> diff --git a/kallithea/controllers/changeset.py b/kallithea/controllers/changeset.py
> --- a/kallithea/controllers/changeset.py
> +++ b/kallithea/controllers/changeset.py
> @@ -75,7 +75,10 @@ def get_ignore_ws(fid, GET):
>       ig_ws_global = GET.get('ignorews')
>       ig_ws = filter(lambda k: k.startswith('WS'), GET.getall(fid))
>       if ig_ws:
> -        return int(ig_ws[0].split(':')[-1])
> +        try:
> +            return int(ig_ws[0].split(':')[-1])
> +        except ValueError:
> +            pass

So ... I would still suggest to raise HTTPBadRequest() instead.

If you insist, I will forward support requests to you ;-)

/Mads



More information about the kallithea-general mailing list