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

SourceForge.net noreply at sourceforge.net
Tue Jan 24 16:52:23 CET 2006


Bugs item #495682, was opened at 2001-12-21 01:22
Message generated for change (Comment added) made by loewis
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=495682&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: Feature Request
>Status: Closed
>Resolution: Fixed
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 at 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: Martin v. Löwis (loewis)
Date: 2006-01-24 16:52

Message:
Logged In: YES 
user_id=21627

Fixed with said patch.

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

Comment By: Johannes Nicolai (jonico)
Date: 2005-11-05 18:09

Message:
Logged In: YES 
user_id=863272

I have proposed a patch for this in the patch section: 
1349118 is the number of the patch 
URL: 
https://sourceforge.net/tracker/index.php?func=detail&aid=1349118&group_id=5470&atid=305470 
The patch also solves some other issues with proxies (now it 
correct handles protocols, where a proxy was specified but not 
supported and https proxies will also be used if a host requires 
www-authentification) 

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

Comment By: Guido van Rossum (gvanrossum)
Date: 2001-12-28 23: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: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=495682&group_id=5470


More information about the Python-bugs-list mailing list