Bugs item #944396, was opened at 2004-04-29 16:34
Message generated for change (Comment added) made by orsenthil
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=944396&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: None
Group: None
Status: Closed
Resolution: Duplicate
Priority: 5
Private: No
Submitted By: Chris Withers (fresh)
Assigned to: Nobody/Anonymous (nobody)
Summary: urllib2 doesn't handle username/password in url

Initial Comment:
>>> urllib2.urlopen('http://username:[EMAIL PROTECTED]')
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "C:\PYTHON23\lib\urllib2.py", line 129, in urlopen
    return _opener.open(url, data)
  File "C:\PYTHON23\lib\urllib2.py", line 326, in open
    '_open', req)
  File "C:\PYTHON23\lib\urllib2.py", line 306, in
_call_chain
    result = func(*args)
  File "C:\PYTHON23\lib\urllib2.py", line 901, in http_open
    return self.do_open(httplib.HTTP, req)
  File "C:\PYTHON23\lib\urllib2.py", line 860, in do_open
    h = http_class(host) # will parse host:port
  File "C:\Python23\lib\httplib.py", line 1009, in __init__
    self._setup(self._connection_class(host, port, strict))
  File "C:\Python23\lib\httplib.py", line 507, in __init__
    self._set_hostport(host, port)
  File "C:\Python23\lib\httplib.py", line 518, in
_set_hostport
    raise InvalidURL("nonnumeric port: '%s'" % host[i+1:])
httplib.InvalidURL: nonnumeric port: '[EMAIL PROTECTED]'

cheers,

Chris

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

Comment By: O.R.Senthil Kumaran (orsenthil)
Date: 2006-11-13 19:30

Message:
Logged In: YES 
user_id=942711

It does handle:

proxy_user = 'user_name'
proxy_password ='password'

# Setup the Proxy with urllib2

proxy_url = 'http://' + proxy_user + ':' + proxy_password + '@' + PROXY_IP

proxy_support = urllib2.ProxyHandler({"http":proxy_url})
opener = urllib2.build_opener(proxy_support,urllib2.HTTPHandler)
urllib2.install_opener(opener)

Worked properly for me so long.


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

Comment By: Georg Brandl (gbrandl)
Date: 2006-02-21 02:30

Message:
Logged In: YES 
user_id=849994

This is also reported by #979407.

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

Comment By: Sjoerd Mullender (sjoerd)
Date: 2004-05-06 02:52

Message:
Logged In: YES 
user_id=43607

I don't know (nor care) about RFC 1738, but it's successor
RFC 2396 *does* mention <userinfo>@<host>:<port> as a
possible "server".  See section 3.2.2.  I admit, it also
says that it is not recommended, but it does specifically
allow username + password in the URI.

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

Comment By: Chris Withers (fresh)
Date: 2004-05-06 02:31

Message:
Logged In: YES 
user_id=24723

However, given that the original urllib supported this, it
is suprising that urllib2 doesn't.

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

Comment By: Andrew Langmead (langmead)
Date: 2004-05-06 02:04

Message:
Logged In: YES 
user_id=119306

Although allowing a username and password in the URL is a 
common client extension, it is not part of the standard <http://
rfc.net/rfc1738.html#s3.3.>

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

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=944396&group_id=5470
_______________________________________________
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to