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
9642eedc
Kaydet (Commit)
9642eedc
authored
May 13, 2016
tarafından
Senthil Kumaran
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #26892: Honor debuglevel flag in urllib.request.HTTPHandler.
Patch contributed by Chi Hsuan Yen.
üst
c7635892
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
2 deletions
+13
-2
test_urllib2.py
Lib/test/test_urllib2.py
+9
-2
request.py
Lib/urllib/request.py
+1
-0
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/test/test_urllib2.py
Dosyayı görüntüle @
9642eedc
...
...
@@ -480,8 +480,8 @@ class MockHTTPSHandler(urllib.request.AbstractHTTPHandler):
# Useful for testing the Proxy-Authorization request by verifying the
# properties of httpcon
def
__init__
(
self
):
urllib
.
request
.
AbstractHTTPHandler
.
__init__
(
self
)
def
__init__
(
self
,
debuglevel
=
0
):
urllib
.
request
.
AbstractHTTPHandler
.
__init__
(
self
,
debuglevel
=
debuglevel
)
self
.
httpconn
=
MockHTTPClass
()
def
https_open
(
self
,
req
):
...
...
@@ -950,6 +950,13 @@ class HandlerTests(unittest.TestCase):
newreq
=
h
.
do_request_
(
req
)
self
.
assertEqual
(
int
(
newreq
.
get_header
(
'Content-length'
)),
16
)
def
test_http_handler_debuglevel
(
self
):
o
=
OpenerDirector
()
h
=
MockHTTPSHandler
(
debuglevel
=
1
)
o
.
add_handler
(
h
)
o
.
open
(
"https://www.example.com"
)
self
.
assertEqual
(
h
.
_debuglevel
,
1
)
def
test_http_doubleslash
(
self
):
# Checks the presence of any unnecessary double slash in url does not
# break anything. Previously, a double slash directly after the host
...
...
Lib/urllib/request.py
Dosyayı görüntüle @
9642eedc
...
...
@@ -1211,6 +1211,7 @@ class AbstractHTTPHandler(BaseHandler):
# will parse host:port
h
=
http_class
(
host
,
timeout
=
req
.
timeout
,
**
http_conn_args
)
h
.
set_debuglevel
(
self
.
_debuglevel
)
headers
=
dict
(
req
.
unredirected_hdrs
)
headers
.
update
(
dict
((
k
,
v
)
for
k
,
v
in
req
.
headers
.
items
()
...
...
Misc/NEWS
Dosyayı görüntüle @
9642eedc
...
...
@@ -118,6 +118,9 @@ Core and Builtins
Library
-------
- Issue #26892: Honor debuglevel flag in urllib.request.HTTPHandler. Patch
contributed by Chi Hsuan Yen.
- Issue #22274: In the subprocess module, allow stderr to be redirected to
stdout even when stdout is not redirected. Patch by Akira Li.
...
...
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