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
c9557af4
Kaydet (Commit)
c9557af4
authored
May 12, 2011
tarafından
Gregory P. Smith
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
merge - 7a3f3ad83676 Fixes Issue #12044.
üst
79a11e71
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
3 deletions
+10
-3
subprocess.rst
Doc/library/subprocess.rst
+2
-2
subprocess.py
Lib/subprocess.py
+2
-0
test_subprocess.py
Lib/test/test_subprocess.py
+2
-1
NEWS
Misc/NEWS
+4
-0
No files found.
Doc/library/subprocess.rst
Dosyayı görüntüle @
c9557af4
...
...
@@ -217,8 +217,8 @@ This module defines one class called :class:`Popen`:
*creationflags*, if given, can be :data:`CREATE_NEW_CONSOLE` or
:data:`CREATE_NEW_PROCESS_GROUP`. (Windows only)
Popen objects are supported as context managers via the :keyword:`with` statement
,
closing any open file descriptors on exit
.
Popen objects are supported as context managers via the :keyword:`with` statement
:
on exit, standard file descriptors are closed, and the process is waited for
.
::
with Popen(["ifconfig"], stdout=PIPE) as proc:
...
...
Lib/subprocess.py
Dosyayı görüntüle @
c9557af4
...
...
@@ -764,6 +764,8 @@ class Popen(object):
self
.
stderr
.
close
()
if
self
.
stdin
:
self
.
stdin
.
close
()
# Wait for the process to terminate, to avoid zombies.
self
.
wait
()
def
__del__
(
self
,
_maxsize
=
sys
.
maxsize
,
_active
=
_active
):
if
not
self
.
_child_created
:
...
...
Lib/test/test_subprocess.py
Dosyayı görüntüle @
c9557af4
...
...
@@ -1491,7 +1491,8 @@ class ContextManagerTests(ProcessTestCase):
def
test_returncode
(
self
):
with
subprocess
.
Popen
([
sys
.
executable
,
"-c"
,
"import sys; sys.exit(100)"
])
as
proc
:
proc
.
wait
()
pass
# __exit__ calls wait(), so the returncode should be set
self
.
assertEqual
(
proc
.
returncode
,
100
)
def
test_communicate_stdin
(
self
):
...
...
Misc/NEWS
Dosyayı görüntüle @
c9557af4
...
...
@@ -10,6 +10,10 @@ What's New in Python 3.2.1?
Core and Builtins
-----------------
- Issue #12044: Fixed subprocess.Popen when used as a context manager to
wait for the process to end when exiting the context to avoid unintentionally
leaving zombie processes around.
- Issue #1195: Fix input() if it is interrupted by CTRL+d and then CTRL+c,
clear the end-of-file indicator after CTRL+d.
...
...
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