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

Commit b378d99

Browse filesBrowse files
gh-101819: Fix _io clinic input for unused base class method stubs (#104418)
When preparing the _io extension module for isolation, many methods were adapted to Argument Clinic. Some of these used the '*args: object' signature, which is incorrect. These are now corrected to an exact signature, and marked unused, since they are stub methods.
1 parent 186bf39 commit b378d99
Copy full SHA for b378d99

File tree

Expand file treeCollapse file tree

6 files changed

+168
-109
lines changed
Filter options
Expand file treeCollapse file tree

6 files changed

+168
-109
lines changed

‎Modules/_io/bufferedio.c

Copy file name to clipboardExpand all lines: Modules/_io/bufferedio.c
+13-13Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -136,15 +136,15 @@ _io__BufferedIOBase_detach_impl(PyObject *self, PyTypeObject *cls)
136136
_io._BufferedIOBase.read
137137
138138
cls: defining_class
139+
size: int(unused=True) = -1
139140
/
140-
*args: object
141141
142142
Read and return up to n bytes.
143143
144-
If the argument is omitted, None, or negative, read and
144+
If the size argument is omitted, None, or negative, read and
145145
return all data until EOF.
146146
147-
If the argument is positive, and the underlying raw stream is
147+
If the size argument is positive, and the underlying raw stream is
148148
not 'interactive', multiple raw reads may be issued to satisfy
149149
the byte count (unless EOF is reached first).
150150
However, for interactive raw streams (as well as sockets and pipes),
@@ -159,8 +159,8 @@ mode and no data is available at the moment.
159159

160160
static PyObject *
161161
_io__BufferedIOBase_read_impl(PyObject *self, PyTypeObject *cls,
162-
PyObject *args)
163-
/*[clinic end generated code: output=4521b30940fd7b67 input=390205758adc8510]*/
162+
int Py_UNUSED(size))
163+
/*[clinic end generated code: output=aceb2765587b0a29 input=824f6f910465e61a]*/
164164
{
165165
_PyIO_State *state = get_io_state_by_cls(cls);
166166
return bufferediobase_unsupported(state, "read");
@@ -170,19 +170,19 @@ _io__BufferedIOBase_read_impl(PyObject *self, PyTypeObject *cls,
170170
_io._BufferedIOBase.read1
171171
172172
cls: defining_class
173+
size: int(unused=True) = -1
173174
/
174-
*args: object
175175
176-
Read and return up to n bytes, with at most one read() call to the underlying raw stream.
176+
Read and return up to size bytes, with at most one read() call to the underlying raw stream.
177177
178178
Return an empty bytes object on EOF.
179179
A short result does not imply that EOF is imminent.
180180
[clinic start generated code]*/
181181

182182
static PyObject *
183183
_io__BufferedIOBase_read1_impl(PyObject *self, PyTypeObject *cls,
184-
PyObject *args)
185-
/*[clinic end generated code: output=636fd241c21e050a input=ef546a1238c5b41c]*/
184+
int Py_UNUSED(size))
185+
/*[clinic end generated code: output=2e7fc62972487eaa input=af76380e020fd9e6]*/
186186
{
187187
_PyIO_State *state = get_io_state_by_cls(cls);
188188
return bufferediobase_unsupported(state, "read1");
@@ -192,10 +192,10 @@ _io__BufferedIOBase_read1_impl(PyObject *self, PyTypeObject *cls,
192192
_io._BufferedIOBase.write
193193
194194
cls: defining_class
195+
b: object(unused=True)
195196
/
196-
*args: object
197197
198-
Write the given buffer to the IO stream.
198+
Write buffer b to the IO stream.
199199
200200
Return the number of bytes written, which is always
201201
the length of b in bytes.
@@ -206,8 +206,8 @@ underlying raw stream cannot accept more data at the moment.
206206

207207
static PyObject *
208208
_io__BufferedIOBase_write_impl(PyObject *self, PyTypeObject *cls,
209-
PyObject *args)
210-
/*[clinic end generated code: output=d51feea4bcac9892 input=f79b72c4dccb3dc2]*/
209+
PyObject *Py_UNUSED(b))
210+
/*[clinic end generated code: output=712c635246bf2306 input=9793f5c8f71029ad]*/
211211
{
212212
_PyIO_State *state = get_io_state_by_cls(cls);
213213
return bufferediobase_unsupported(state, "write");

‎Modules/_io/clinic/bufferedio.c.h

Copy file name to clipboardExpand all lines: Modules/_io/clinic/bufferedio.c.h
+40-29Lines changed: 40 additions & 29 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Modules/_io/clinic/iobase.c.h

Copy file name to clipboardExpand all lines: Modules/_io/clinic/iobase.c.h
+37-21Lines changed: 37 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.