Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
8deab967
Commit
8deab967
authored
Oct 20, 2018
by
David Herberth
Committed by
Victor Stinner
Oct 20, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bpo-34070: open() only checks for isatty if buffering < 0 (GH-8187)
parent
acef6906
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
Misc/NEWS.d/next/Library/2018-07-11-20-51-20.bpo-34070.WpmFAu.rst
...S.d/next/Library/2018-07-11-20-51-20.bpo-34070.WpmFAu.rst
+2
-0
Modules/_io/_iomodule.c
Modules/_io/_iomodule.c
+3
-3
No files found.
Misc/NEWS.d/next/Library/2018-07-11-20-51-20.bpo-34070.WpmFAu.rst
0 → 100644
View file @
8deab967
Make sure to only check if the handle is a tty, when opening
a file with ``buffering=-1``.
Modules/_io/_iomodule.c
View file @
8deab967
...
...
@@ -241,7 +241,7 @@ _io_open_impl(PyObject *module, PyObject *file, const char *mode,
char
rawmode
[
6
],
*
m
;
int
line_buffering
,
is_number
;
long
isatty
;
long
isatty
=
0
;
PyObject
*
raw
,
*
modeobj
=
NULL
,
*
buffer
,
*
wrapper
,
*
result
=
NULL
,
*
path_or_fd
=
NULL
;
...
...
@@ -388,7 +388,7 @@ _io_open_impl(PyObject *module, PyObject *file, const char *mode,
goto
error
;
/* buffering */
{
if
(
buffering
<
0
)
{
PyObject
*
res
=
_PyObject_CallMethodId
(
raw
,
&
PyId_isatty
,
NULL
);
if
(
res
==
NULL
)
goto
error
;
...
...
@@ -398,7 +398,7 @@ _io_open_impl(PyObject *module, PyObject *file, const char *mode,
goto
error
;
}
if
(
buffering
==
1
||
(
buffering
<
0
&&
isatty
)
)
{
if
(
buffering
==
1
||
isatty
)
{
buffering
=
-
1
;
line_buffering
=
1
;
}
...
...
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