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
e97a24d0
Kaydet (Commit)
e97a24d0
authored
Eki 21, 2012
tarafından
Antoine Pitrou
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #16220: wsgiref now always calls close() on an iterable response.
Patch by Brent Tubbs.
üst
c859bd2b
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
31 deletions
+25
-31
test_wsgiref.py
Lib/test/test_wsgiref.py
+19
-31
handlers.py
Lib/wsgiref/handlers.py
+2
-0
ACKS
Misc/ACKS
+1
-0
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/test/test_wsgiref.py
Dosyayı görüntüle @
e97a24d0
...
@@ -591,40 +591,28 @@ class HandlerTests(TestCase):
...
@@ -591,40 +591,28 @@ class HandlerTests(TestCase):
(
stdpat
%
(
version
,
sw
),
h
.
stdout
.
getvalue
())
(
stdpat
%
(
version
,
sw
),
h
.
stdout
.
getvalue
())
)
)
# This epilogue is needed for compatibility with the Python 2.5 regrtest module
def
testCloseOnError
(
self
):
side_effects
=
{
'close_called'
:
False
}
MSG
=
b
"Some output has been sent"
def
error_app
(
e
,
s
):
s
(
"200 OK"
,[])(
MSG
)
class
CrashyIterable
(
object
):
def
__iter__
(
self
):
while
True
:
yield
b
'blah'
raise
AssertionError
(
"This should be caught by handler"
)
def
close
(
self
):
side_effects
[
'close_called'
]
=
True
return
CrashyIterable
()
h
=
ErrorHandler
()
h
.
run
(
error_app
)
self
.
assertEqual
(
side_effects
[
'close_called'
],
True
)
def
test_main
():
def
test_main
():
test_support
.
run_unittest
(
__name__
)
test_support
.
run_unittest
(
__name__
)
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
test_main
()
test_main
()
# the above lines intentionally left blank
Lib/wsgiref/handlers.py
Dosyayı görüntüle @
e97a24d0
...
@@ -122,10 +122,12 @@ class BaseHandler:
...
@@ -122,10 +122,12 @@ class BaseHandler:
in the event loop to iterate over the data, and to call
in the event loop to iterate over the data, and to call
'self.close()' once the response is finished.
'self.close()' once the response is finished.
"""
"""
try
:
if
not
self
.
result_is_file
()
or
not
self
.
sendfile
():
if
not
self
.
result_is_file
()
or
not
self
.
sendfile
():
for
data
in
self
.
result
:
for
data
in
self
.
result
:
self
.
write
(
data
)
self
.
write
(
data
)
self
.
finish_content
()
self
.
finish_content
()
finally
:
self
.
close
()
self
.
close
()
...
...
Misc/ACKS
Dosyayı görüntüle @
e97a24d0
...
@@ -985,6 +985,7 @@ Richard Townsend
...
@@ -985,6 +985,7 @@ Richard Townsend
Laurence Tratt
Laurence Tratt
John Tromp
John Tromp
Jason Trowbridge
Jason Trowbridge
Brent Tubbs
Anthony Tuininga
Anthony Tuininga
David Turner
David Turner
Stephen Turner
Stephen Turner
...
...
Misc/NEWS
Dosyayı görüntüle @
e97a24d0
...
@@ -122,6 +122,9 @@ Core and Builtins
...
@@ -122,6 +122,9 @@ Core and Builtins
Library
Library
-------
-------
-
Issue
#
16220
:
wsgiref
now
always
calls
close
()
on
an
iterable
response
.
Patch
by
Brent
Tubbs
.
-
Issue
#
16176
:
Properly
identify
Windows
8
via
platform
.
platform
()
-
Issue
#
16176
:
Properly
identify
Windows
8
via
platform
.
platform
()
-
Issue
#
15756
:
subprocess
.
poll
()
now
properly
handles
errno
.
ECHILD
to
-
Issue
#
15756
:
subprocess
.
poll
()
now
properly
handles
errno
.
ECHILD
to
...
...
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