Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
78c96370
Kaydet (Commit)
78c96370
authored
Agu 26, 1996
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Bump exposed __version__ to 1.4.
Correctly handle a URL containing user:password@host when using a proxy.
üst
dfcf35dc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
urllib.py
Lib/urllib.py
+9
-6
No files found.
Lib/urllib.py
Dosyayı görüntüle @
78c96370
...
...
@@ -20,7 +20,7 @@ import regex
import
os
__version__
=
'1.
3
'
__version__
=
'1.
4
'
# Helper for non-unix systems
if
os
.
name
==
'mac'
:
...
...
@@ -179,15 +179,18 @@ class URLopener:
import
httplib
if
type
(
url
)
is
type
(
""
):
host
,
selector
=
splithost
(
url
)
user_passwd
,
host
=
splituser
(
host
)
else
:
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
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
:
import
base64
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