[Python-bugs-list] [ python-Bugs-495682 ] cannot handle http_proxy with user:pass@

noreply@sourceforge.net noreply@sourceforge.net
Fri, 28 Dec 2001 14:28:09 -0800


Bugs item #495682, was opened at 2001-12-20 16:22
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=495682&group_id=5470

Category: Python Library
>Group: Feature Request
Status: Open
Resolution: None
>Priority: 3
Submitted By: Matthias Klose (doko)
Assigned to: Nobody/Anonymous (nobody)
Summary: cannot handle http_proxy with user:pass@

Initial Comment:
[please CC 120013@bugs.debian.org; the original report 
can be found at http://bugs.debian.org/120013 ]

I tried to use an http_proxy variable which looks 
like: 
http://user:pass@proxy:3128/

with pass like \jkIoPd{

And I got this error :

Traceback (most recent call last):
  File "/usr/bin/reportbug", line 1146, in ?
    main()
  File "/usr/bin/reportbug", line 628, in main
    http_proxy)
  File "/usr/lib/site-python/reportbug_ui_text.py", 
line 314, in
  handle_bts_query
    archived=archived)
  File "/usr/lib/site-python/debianbts.py", line 575, 
in get_reports
    result = get_cgi_reports(package, system, 
http_proxy, archived)
  File "/usr/lib/site-python/debianbts.py", line 494, 
in get_cgi_reports
    page = urlopen(url, proxies=proxies)
  File "/usr/lib/site-python/debianbts.py", line 382, 
in urlopen
    return _urlopener.open(url)
  File "/usr/lib/python2.1/urllib.py", line 176, in 
open
    return getattr(self, name)(url)
  File "/usr/lib/python2.1/urllib.py", line 277, in 
open_http
    h = httplib.HTTP(host)
  File "/usr/lib/python2.1/httplib.py", line 663, in 
__init__
    self._conn = self._connection_class(host, port)
  File "/usr/lib/python2.1/httplib.py", line 342, in 
__init__
    self._set_hostport(host, port)
  File "/usr/lib/python2.1/httplib.py", line 348, in 
_set_hostport
    port = int(host[i+1:])
ValueError: invalid literal for int(): \jkIoPd
{@proxy:3128

But if I use http_proxy=http://10.0.0.1:3128/, it 
works well.


----------------------------------------------------------------------

>Comment By: Guido van Rossum (gvanrossum)
Date: 2001-12-28 14:28

Message:
Logged In: YES 
user_id=6380

This is a feature request. If someone submits a patch, we'll
happily apply it.

It looks like urllib2 already supports this feature; you
could try using that.

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=495682&group_id=5470