summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_cmd_line_script.py
diff options
context:
space:
mode:
authorAlexey Izbyshev <izbyshev@ispras.ru>2018-10-20 00:22:31 (GMT)
committerVictor Stinner <vstinner@redhat.com>2018-10-20 00:22:31 (GMT)
commita2670565d8f5c502388378aba1fe73023fd8c8d4 (patch)
treea9f3a5f8e2a123aaff4f27a94c33580f0216dccd /Lib/test/test_cmd_line_script.py
parent4acf6c9d4be77b968fa498569d7a1545e5e77344 (diff)
downloadcpython-a2670565d8f5c502388378aba1fe73023fd8c8d4.zip
cpython-a2670565d8f5c502388378aba1fe73023fd8c8d4.tar.gz
cpython-a2670565d8f5c502388378aba1fe73023fd8c8d4.tar.bz2
bpo-32236: open() emits RuntimeWarning if buffering=1 for binary mode (GH-4842)
If buffering=1 is specified for open() in binary mode, it is silently treated as buffering=-1 (i.e., the default buffer size). Coupled with the fact that line buffering is always supported in Python 2, such behavior caused several issues (e.g., bpo-10344, bpo-21332). Warn that line buffering is not supported if open() is called with binary mode and buffering=1.
Diffstat (limited to 'Lib/test/test_cmd_line_script.py')
-rw-r--r--Lib/test/test_cmd_line_script.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/test/test_cmd_line_script.py b/Lib/test/test_cmd_line_script.py
index 5ec9bbb..bc812ea 100644
--- a/Lib/test/test_cmd_line_script.py
+++ b/Lib/test/test_cmd_line_script.py
@@ -169,10 +169,10 @@ class CmdLineTest(unittest.TestCase):
@contextlib.contextmanager
def interactive_python(self, separate_stderr=False):
if separate_stderr:
- p = spawn_python('-i', bufsize=1, stderr=subprocess.PIPE)
+ p = spawn_python('-i', stderr=subprocess.PIPE)
stderr = p.stderr
else:
- p = spawn_python('-i', bufsize=1, stderr=subprocess.STDOUT)
+ p = spawn_python('-i', stderr=subprocess.STDOUT)
stderr = p.stdout
try:
# Drain stderr until prompt