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
f87afb03
Kaydet (Commit)
f87afb03
authored
Mar 08, 2015
tarafından
Serhiy Storchaka
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #21619: Cleaned up test_broken_pipe_cleanup.
Patch by Martin Panter.
üst
e3207fe8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
10 deletions
+8
-10
test_subprocess.py
Lib/test/test_subprocess.py
+8
-10
No files found.
Lib/test/test_subprocess.py
Dosyayı görüntüle @
f87afb03
...
...
@@ -2523,21 +2523,19 @@ class ContextManagerTests(BaseTestCase):
def
test_broken_pipe_cleanup
(
self
):
"""Broken pipe error should not prevent wait() (Issue 21619)"""
args
=
[
sys
.
executable
,
"-c"
,
"import sys;"
"sys.stdin.close();"
"sys.stdout.close();"
]
# Signals that input pipe is closed
proc
=
subprocess
.
Popen
(
args
,
proc
=
subprocess
.
Popen
([
sys
.
executable
,
'-c'
,
'pass'
],
stdin
=
subprocess
.
PIPE
,
stdout
=
subprocess
.
PIPE
,
bufsize
=
support
.
PIPE_MAX_SIZE
*
2
)
proc
.
stdout
.
read
()
# Make sure subprocess has closed its input
proc
.
stdin
.
write
(
b
"x"
*
support
.
PIPE_MAX_SIZE
)
proc
=
proc
.
__enter__
()
# Prepare to send enough data to overflow any OS pipe buffering and
# guarantee a broken pipe error. Data is held in BufferedWriter
# buffer until closed.
proc
.
stdin
.
write
(
b
'x'
*
support
.
PIPE_MAX_SIZE
)
self
.
assertIsNone
(
proc
.
returncode
)
# EPIPE expected under POSIX; EINVAL under Windows
self
.
assertRaises
(
OSError
,
proc
.
__exit__
,
None
,
None
,
None
)
self
.
assertEqual
(
0
,
proc
.
returncode
)
self
.
assertEqual
(
proc
.
returncode
,
0
)
self
.
assertTrue
(
proc
.
stdin
.
closed
)
self
.
assertTrue
(
proc
.
stdout
.
closed
)
def
test_main
():
...
...
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