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
84560b36
Commit
84560b36
authored
Aug 26, 1996
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bump exposed __version__ to 1.4.
Correctly handle a URL containing user:password@host when using a proxy.
parent
78268557
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
Lib/urllib.py
Lib/urllib.py
+9
-6
No files found.
Lib/urllib.py
View file @
84560b36
...
@@ -20,7 +20,7 @@ import regex
...
@@ -20,7 +20,7 @@ import regex
import
os
import
os
__version__
=
'1.
3
'
__version__
=
'1.
4
'
# Helper for non-unix systems
# Helper for non-unix systems
if
os
.
name
==
'mac'
:
if
os
.
name
==
'mac'
:
...
@@ -179,15 +179,18 @@ class URLopener:
...
@@ -179,15 +179,18 @@ class URLopener:
import
httplib
import
httplib
if
type
(
url
)
is
type
(
""
):
if
type
(
url
)
is
type
(
""
):
host
,
selector
=
splithost
(
url
)
host
,
selector
=
splithost
(
url
)
user_passwd
,
host
=
splituser
(
host
)
else
:
else
:
host
,
selector
=
url
host
,
selector
=
url
urltype
,
rest
=
splittype
(
selector
)
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
not
host
:
raise
IOError
,
(
'http error'
,
'no host given'
)
i
=
string
.
find
(
host
,
'@'
)
if
i
>=
0
:
user_passwd
,
host
=
host
[:
i
],
host
[
i
+
1
:]
else
:
user_passwd
=
None
if
user_passwd
:
if
user_passwd
:
import
base64
import
base64
auth
=
string
.
strip
(
base64
.
encodestring
(
user_passwd
))
auth
=
string
.
strip
(
base64
.
encodestring
(
user_passwd
))
...
...
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