mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Fix two small bugs with proxies.
This commit is contained in:
parent
a9a3575e26
commit
fd79566d0f
1 changed files with 2 additions and 1 deletions
|
@ -204,13 +204,14 @@ class URLopener:
|
|||
else:
|
||||
host, selector = url
|
||||
urltype, rest = splittype(selector)
|
||||
user_passwd = None
|
||||
if string.lower(urltype) == 'http':
|
||||
realhost, rest = splithost(rest)
|
||||
user_passwd, realhost = splituser(realhost)
|
||||
if user_passwd:
|
||||
selector = "%s://%s%s" % (urltype,
|
||||
realhost, rest)
|
||||
print "proxy via http:", host, selector
|
||||
#print "proxy via http:", host, selector
|
||||
if not host: raise IOError, ('http error', 'no host given')
|
||||
if user_passwd:
|
||||
import base64
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue