[PATCH] bin/pwclient: accept alternate http_proxy forms
Stephen Finucane
stephen at that.guru
Sat Dec 24 10:11:15 AEDT 2016
On Thu, 2016-12-22 at 22:09 +0100, Yann E. MORIN wrote:
> The forms for http_proxy (and the likes) is not very well defined nor
> documented in any authoritaive place. However, there are two common
> forms: http://host:port or http://host:port/
>
> Currently, the code chokes on the latter (e.g. with
> http_proxy=http://127.0.0.1:8080/ ):
>
> [...]
> File "/usr/lib/python2.7/httplib.py", line 792, in
> _get_hostport
> raise InvalidURL("nonnumeric port: '%s'" % host[i+1:])
> httplib.InvalidURL: nonnumeric port: '8080/'
>
> Chop off any slash character in the port definition to accept the
> second
> form. If there is no '/' in there, it still works.
>
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998 at free.fr>
> Cc: Stephen Finucane <stephenfinucane at hotmail.com>
I changed this to use 'rstrip' instead and applied. Thanks :)
Stephen
More information about the Patchwork
mailing list