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
77732be8
Kaydet (Commit)
77732be8
authored
Eki 04, 2017
tarafından
Serhiy Storchaka
Kaydeden (comit)
GitHub
Eki 04, 2017
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
bpo-30404: The -u option now makes the stdout and stderr streams totally unbuffered. (#1667)
üst
0b5e61dd
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
12 deletions
+17
-12
cmdline.rst
Doc/using/cmdline.rst
+4
-4
test_cmd_line.py
Lib/test/test_cmd_line.py
+3
-4
2017-10-03-23-46-39.bpo-30404._9Yi5u.rst
...ore and Builtins/2017-10-03-23-46-39.bpo-30404._9Yi5u.rst
+2
-0
pylifecycle.c
Python/pylifecycle.c
+8
-4
No files found.
Doc/using/cmdline.rst
Dosyayı görüntüle @
77732be8
...
...
@@ -303,13 +303,13 @@ Miscellaneous options
.. cmdoption:: -u
Force the binary layer of the stdout and stderr streams (which is
available as their ``buffer`` attribute) to be unbuffered. The text I/O
layer will still be line-buffered if writing to the console, or
block-buffered if redirected to a non-interactive file.
Force the stdout and stderr streams to be unbuffered.
See also :envvar:`PYTHONUNBUFFERED`.
.. versionchanged:: 3.7
The text layer of the stdout and stderr streams now is unbuffered.
.. cmdoption:: -v
...
...
Lib/test/test_cmd_line.py
Dosyayı görüntüle @
77732be8
...
...
@@ -221,13 +221,12 @@ class CmdLineTest(unittest.TestCase):
rc
,
out
,
err
=
assert_python_ok
(
'-u'
,
'-c'
,
code
)
data
=
err
if
stream
==
'stderr'
else
out
self
.
assertEqual
(
data
,
b
'x'
,
"binary
%
s not unbuffered"
%
stream
)
# Text is
line-
buffered
code
=
(
"import os, sys; sys.
%
s.write('x
\\
n
'); os._exit(0)"
# Text is
un
buffered
code
=
(
"import os, sys; sys.
%
s.write('x'); os._exit(0)"
%
stream
)
rc
,
out
,
err
=
assert_python_ok
(
'-u'
,
'-c'
,
code
)
data
=
err
if
stream
==
'stderr'
else
out
self
.
assertEqual
(
data
.
strip
(),
b
'x'
,
"text
%
s not line-buffered"
%
stream
)
self
.
assertEqual
(
data
,
b
'x'
,
"text
%
s not unbuffered"
%
stream
)
def
test_unbuffered_input
(
self
):
# sys.stdin still works with '-u'
...
...
Misc/NEWS.d/next/Core and Builtins/2017-10-03-23-46-39.bpo-30404._9Yi5u.rst
0 → 100644
Dosyayı görüntüle @
77732be8
The -u option now makes the stdout and stderr streams unbuffered rather than
line-buffered.
Python/pylifecycle.c
Dosyayı görüntüle @
77732be8
...
...
@@ -1498,7 +1498,7 @@ create_stdio(PyObject* io,
PyObject
*
buf
=
NULL
,
*
stream
=
NULL
,
*
text
=
NULL
,
*
raw
=
NULL
,
*
res
;
const
char
*
mode
;
const
char
*
newline
;
PyObject
*
line_buffering
;
PyObject
*
line_buffering
,
*
write_through
;
int
buffering
,
isatty
;
_Py_IDENTIFIER
(
open
);
_Py_IDENTIFIER
(
isatty
);
...
...
@@ -1555,7 +1555,11 @@ create_stdio(PyObject* io,
Py_DECREF
(
res
);
if
(
isatty
==
-
1
)
goto
error
;
if
(
isatty
||
Py_UnbufferedStdioFlag
)
if
(
Py_UnbufferedStdioFlag
)
write_through
=
Py_True
;
else
write_through
=
Py_False
;
if
(
isatty
&&
!
Py_UnbufferedStdioFlag
)
line_buffering
=
Py_True
;
else
line_buffering
=
Py_False
;
...
...
@@ -1574,9 +1578,9 @@ create_stdio(PyObject* io,
newline
=
"
\n
"
;
#endif
stream
=
_PyObject_CallMethodId
(
io
,
&
PyId_TextIOWrapper
,
"OsssO"
,
stream
=
_PyObject_CallMethodId
(
io
,
&
PyId_TextIOWrapper
,
"OsssO
O
"
,
buf
,
encoding
,
errors
,
newline
,
line_buffering
);
newline
,
line_buffering
,
write_through
);
Py_CLEAR
(
buf
);
if
(
stream
==
NULL
)
goto
error
;
...
...
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