bpo-32236: Issue RuntimeWarning if buffering=1 for open() in binary mode by izbyshev · Pull Request #4842 · python/cpython (original) (raw)
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).
Raise ValueError on attempts to use line buffering in binary mode to prevent
possible bugs and expose existing buggy code.