mirror of
https://github.com/python/cpython.git
synced 2025-11-13 15:40:05 +00:00
Raise ValueError when attempting to set the _CHUNK_SIZE attribute of a TextIOWrapper to a huge value, not TypeError.
This commit is contained in:
parent
fd060474e3
commit
cb4ae815b5
2 changed files with 4 additions and 1 deletions
|
|
@ -27,6 +27,9 @@ Core and Builtins
|
||||||
Library
|
Library
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
- Raise ValueError when attempting to set the _CHUNK_SIZE attribute of a
|
||||||
|
TextIOWrapper to a huge value, not TypeError.
|
||||||
|
|
||||||
- Issue #12493: subprocess: Popen.communicate() now also handles EINTR errors
|
- Issue #12493: subprocess: Popen.communicate() now also handles EINTR errors
|
||||||
if the process has only one pipe.
|
if the process has only one pipe.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2556,7 +2556,7 @@ textiowrapper_chunk_size_set(textio *self, PyObject *arg, void *context)
|
||||||
{
|
{
|
||||||
Py_ssize_t n;
|
Py_ssize_t n;
|
||||||
CHECK_INITIALIZED_INT(self);
|
CHECK_INITIALIZED_INT(self);
|
||||||
n = PyNumber_AsSsize_t(arg, PyExc_TypeError);
|
n = PyNumber_AsSsize_t(arg, PyExc_ValueError);
|
||||||
if (n == -1 && PyErr_Occurred())
|
if (n == -1 && PyErr_Occurred())
|
||||||
return -1;
|
return -1;
|
||||||
if (n <= 0) {
|
if (n <= 0) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue