Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Zipimport test relies on having a size > PY_READ_MAX meaning auto-exp…
…anding buffer
  • Loading branch information
cmaloney committed Jul 11, 2024
commit a487c6bb7d3e8237f23fa7190fdd056f11ec8456
5 changes: 2 additions & 3 deletions Modules/_io/fileio.c
Original file line number Diff line number Diff line change
Expand Up @@ -730,8 +730,8 @@ _io_FileIO_readall_impl(fileio *self)
return err_closed();
}

if (self->stat_atopen != NULL) {
end = (Py_off_t)Py_MIN(self->stat_atopen->st_size, _PY_READ_MAX);
if (self->stat_atopen != NULL && self->stat_atopen->st_size < _PY_READ_MAX) {
end = (Py_off_t)self->stat_atopen->st_size;
}
else {
end = -1;
Expand Down Expand Up @@ -775,7 +775,6 @@ _io_FileIO_readall_impl(fileio *self)
}
}


result = PyBytes_FromStringAndSize(NULL, bufsize);
if (result == NULL)
return NULL;
Expand Down