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
d24c991f
Kaydet (Commit)
d24c991f
authored
Mar 19, 2011
tarafından
Senthil Kumaran
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Merging it again.
üst
af9be06b
d91ffcaf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
1 deletion
+12
-1
test_urllib.py
Lib/test/test_urllib.py
+6
-1
request.py
Lib/urllib/request.py
+6
-0
No files found.
Lib/test/test_urllib.py
Dosyayı görüntüle @
d24c991f
...
@@ -91,7 +91,7 @@ class urlopen_FileTests(unittest.TestCase):
...
@@ -91,7 +91,7 @@ class urlopen_FileTests(unittest.TestCase):
"did not return the expected text"
)
"did not return the expected text"
)
def
test_close
(
self
):
def
test_close
(
self
):
# Test close() by calling it he
ar
and then having it be called again
# Test close() by calling it he
re
and then having it be called again
# by the tearDown() method for the test
# by the tearDown() method for the test
self
.
returned_obj
.
close
()
self
.
returned_obj
.
close
()
...
@@ -174,6 +174,11 @@ class urlopen_HttpTests(unittest.TestCase):
...
@@ -174,6 +174,11 @@ class urlopen_HttpTests(unittest.TestCase):
finally
:
finally
:
self
.
unfakehttp
()
self
.
unfakehttp
()
def
test_willclose
(
self
):
self
.
fakehttp
(
b
"HTTP/1.1 200 OK
\r\n\r\n
Hello!"
)
resp
=
urlopen
(
"http://www.python.org"
)
self
.
assertTrue
(
resp
.
fp
.
will_close
)
def
test_read_0_9
(
self
):
def
test_read_0_9
(
self
):
# "0.9" response accepted (but not "simple responses" without
# "0.9" response accepted (but not "simple responses" without
# a status line)
# a status line)
...
...
Lib/urllib/request.py
Dosyayı görüntüle @
d24c991f
...
@@ -1657,6 +1657,12 @@ class URLopener:
...
@@ -1657,6 +1657,12 @@ class URLopener:
headers
[
"Authorization"
]
=
"Basic
%
s"
%
auth
headers
[
"Authorization"
]
=
"Basic
%
s"
%
auth
if
realhost
:
if
realhost
:
headers
[
"Host"
]
=
realhost
headers
[
"Host"
]
=
realhost
# Add Connection:close as we don't support persistent connections yet.
# This helps in closing the socket and avoiding ResourceWarning
headers
[
"Connection"
]
=
"close"
for
header
,
value
in
self
.
addheaders
:
for
header
,
value
in
self
.
addheaders
:
headers
[
header
]
=
value
headers
[
header
]
=
value
...
...
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