Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
0c95e71f
Commit
0c95e71f
authored
Jan 05, 2008
by
Kurt B. Kaiser
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove dead code brought in by merge glitch @ r59667
parent
8eb45a3a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
71 deletions
+0
-71
Lib/urllib.py
Lib/urllib.py
+0
-71
No files found.
Lib/urllib.py
View file @
0c95e71f
...
...
@@ -402,77 +402,6 @@ class URLopener:
"""Use HTTPS protocol."""
return
self
.
_open_generic_http
(
self
.
_https_connection
,
url
,
data
)
import
httplib
user_passwd
=
None
proxy_passwd
=
None
if
isinstance
(
url
,
str
):
host
,
selector
=
splithost
(
url
)
if
host
:
user_passwd
,
host
=
splituser
(
host
)
host
=
unquote
(
host
)
realhost
=
host
else
:
host
,
selector
=
url
# here, we determine, whether the proxy contains authorization information
proxy_passwd
,
host
=
splituser
(
host
)
urltype
,
rest
=
splittype
(
selector
)
url
=
rest
user_passwd
=
None
if
urltype
.
lower
()
!=
'https'
:
realhost
=
None
else
:
realhost
,
rest
=
splithost
(
rest
)
if
realhost
:
user_passwd
,
realhost
=
splituser
(
realhost
)
if
user_passwd
:
selector
=
"%s://%s%s"
%
(
urltype
,
realhost
,
rest
)
#print "proxy via https:", host, selector
if
not
host
:
raise
IOError
(
'https error'
,
'no host given'
)
if
proxy_passwd
:
import
base64
proxy_auth
=
base64
.
b64encode
(
proxy_passwd
).
strip
()
else
:
proxy_auth
=
None
if
user_passwd
:
import
base64
auth
=
base64
.
b64encode
(
user_passwd
).
strip
()
else
:
auth
=
None
h
=
httplib
.
HTTPS
(
host
,
0
,
key_file
=
self
.
key_file
,
cert_file
=
self
.
cert_file
)
if
data
is
not
None
:
h
.
putrequest
(
'POST'
,
selector
)
h
.
putheader
(
'Content-Type'
,
'application/x-www-form-urlencoded'
)
h
.
putheader
(
'Content-Length'
,
'%d'
%
len
(
data
))
else
:
h
.
putrequest
(
'GET'
,
selector
)
if
proxy_auth
:
h
.
putheader
(
'Proxy-Authorization'
,
'Basic %s'
%
proxy_auth
)
if
auth
:
h
.
putheader
(
'Authorization'
,
'Basic %s'
%
auth
)
if
realhost
:
h
.
putheader
(
'Host'
,
realhost
)
for
args
in
self
.
addheaders
:
h
.
putheader
(
*
args
)
h
.
endheaders
()
if
data
is
not
None
:
h
.
send
(
data
)
errcode
,
errmsg
,
headers
=
h
.
getreply
()
fp
=
h
.
getfile
()
if
errcode
==
-
1
:
if
fp
:
fp
.
close
()
# something went wrong with the HTTP status line
raise
IOError
(
'http protocol error'
,
0
,
'got a bad status line'
,
None
)
# According to RFC 2616, "2xx" code indicates that the client's
# request was successfully received, understood, and accepted.
if
(
200
<=
errcode
<
300
):
return
addinfourl
(
fp
,
headers
,
"https:"
+
url
)
else
:
if
data
is
None
:
return
self
.
http_error
(
url
,
fp
,
errcode
,
errmsg
,
headers
)
else
:
return
self
.
http_error
(
url
,
fp
,
errcode
,
errmsg
,
headers
,
data
)
def
open_file
(
self
,
url
):
"""Use local file or FTP depending on form of URL."""
if
not
isinstance
(
url
,
str
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment