]> granicus.if.org Git - python/commit
bpo-32236: open() emits RuntimeWarning if buffering=1 for binary mode (GH-4842)
authorAlexey Izbyshev <izbyshev@ispras.ru>
Sat, 20 Oct 2018 00:22:31 +0000 (03:22 +0300)
committerVictor Stinner <vstinner@redhat.com>
Sat, 20 Oct 2018 00:22:31 +0000 (02:22 +0200)
commita2670565d8f5c502388378aba1fe73023fd8c8d4
treea9f3a5f8e2a123aaff4f27a94c33580f0216dccd
parent4acf6c9d4be77b968fa498569d7a1545e5e77344
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.
Doc/library/codecs.rst
Lib/_pyio.py
Lib/codecs.py
Lib/subprocess.py
Lib/test/support/__init__.py
Lib/test/test_cmd_line_script.py
Lib/test/test_file.py
Lib/test/test_io.py
Lib/test/test_subprocess.py
Misc/NEWS.d/next/Core and Builtins/2018-09-11-23-50-40.bpo-32236.3RupnN.rst [new file with mode: 0644]
Modules/_io/_iomodule.c