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
1b7da519
Kaydet (Commit)
1b7da519
authored
Eki 05, 2011
tarafından
Senthil Kumaran
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue13104 - Fix urllib.request.thishost() utility function.
üst
ad87fa67
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
1 deletion
+5
-1
test_urllib.py
Lib/test/test_urllib.py
+4
-0
request.py
Lib/urllib/request.py
+1
-1
No files found.
Lib/test/test_urllib.py
Dosyayı görüntüle @
1b7da519
...
@@ -1058,6 +1058,10 @@ class Utility_Tests(unittest.TestCase):
...
@@ -1058,6 +1058,10 @@ class Utility_Tests(unittest.TestCase):
self
.
assertEqual
((
'user'
,
'a
\v
b'
),
urllib
.
parse
.
splitpasswd
(
'user:a
\v
b'
))
self
.
assertEqual
((
'user'
,
'a
\v
b'
),
urllib
.
parse
.
splitpasswd
(
'user:a
\v
b'
))
self
.
assertEqual
((
'user'
,
'a:b'
),
urllib
.
parse
.
splitpasswd
(
'user:a:b'
))
self
.
assertEqual
((
'user'
,
'a:b'
),
urllib
.
parse
.
splitpasswd
(
'user:a:b'
))
def
test_thishost
(
self
):
"""Test the urllib.request.thishost utility function returns a tuple"""
self
.
assertIsInstance
(
urllib
.
request
.
thishost
(),
tuple
)
class
URLopener_Tests
(
unittest
.
TestCase
):
class
URLopener_Tests
(
unittest
.
TestCase
):
"""Testcase to test the open method of URLopener class."""
"""Testcase to test the open method of URLopener class."""
...
...
Lib/urllib/request.py
Dosyayı görüntüle @
1b7da519
...
@@ -2116,7 +2116,7 @@ def thishost():
...
@@ -2116,7 +2116,7 @@ def thishost():
"""Return the IP addresses of the current host."""
"""Return the IP addresses of the current host."""
global
_thishost
global
_thishost
if
_thishost
is
None
:
if
_thishost
is
None
:
_thishost
=
tuple
(
socket
.
gethostbyname_ex
(
socket
.
gethostname
()
[
2
])
)
_thishost
=
tuple
(
socket
.
gethostbyname_ex
(
socket
.
gethostname
()
)[
2
]
)
return
_thishost
return
_thishost
_ftperrors
=
None
_ftperrors
=
None
...
...
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