Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

gh-101819: Refactor _io futher in preparation for module isolation #104369

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
May 11, 2023
Merged
Show file tree
Hide file tree
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
Next Next commit
Fetch module state by class in _io.FileIO.readinto
  • Loading branch information
erlend-aasland committed May 10, 2023
commit 8196135de1acd75b2ebadd70123a97f300f57836
34 changes: 26 additions & 8 deletions 34 Modules/_io/clinic/fileio.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions 7 Modules/_io/fileio.c
Original file line number Diff line number Diff line change
Expand Up @@ -628,23 +628,24 @@ _io_FileIO_seekable_impl(fileio *self)

/*[clinic input]
_io.FileIO.readinto
cls: defining_class
buffer: Py_buffer(accept={rwbuffer})
/

Same as RawIOBase.readinto().
[clinic start generated code]*/

static PyObject *
_io_FileIO_readinto_impl(fileio *self, Py_buffer *buffer)
/*[clinic end generated code: output=b01a5a22c8415cb4 input=4721d7b68b154eaf]*/
_io_FileIO_readinto_impl(fileio *self, PyTypeObject *cls, Py_buffer *buffer)
/*[clinic end generated code: output=97f0f3d69534db34 input=fd20323e18ce1ec8]*/
{
Py_ssize_t n;
int err;

if (self->fd < 0)
return err_closed();
if (!self->readable) {
_PyIO_State *state = IO_STATE();
_PyIO_State *state = get_io_state_by_cls(cls);
return err_mode(state, "reading");
}

Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.