8000 fix: Docstring for stdio indicates binary #9543 · EternityForest/circuitpython@e499614 · GitHub
[go: up one dir, main page]

Skip to content

Commit e499614

Browse files
authored
fix: Docstring for stdio indicates binary adafruit#9543
Docstring for stdio indicates "FileIO", which is a binary IO stream. As detailed in adafruit#553, stdio is not binary by design; its docstring should indicate "StringIO".
1 parent 5e4cecd commit e499614

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

shared/runtime/sys_stdio_mphal.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ STATIC const sys_stdio_obj_t stdio_buffer_obj;
5454

5555
STATIC void stdio_obj_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) {
5656
sys_stdio_obj_t *self = MP_OBJ_TO_PTR(self_in);
57-
mp_printf(print, "<io.FileIO %d>", self->fd);
57+
mp_printf(print, "<io.StringIO %d>", self->fd);
5858
}
5959

6060
STATIC mp_uint_t stdio_read(mp_obj_t self_in, void *buf, mp_uint_t size, int *errcode) {
@@ -122,7 +122,7 @@ STATIC const mp_stream_p_t stdio_obj_stream_p = {
122122

123123
MP_DEFINE_CONST_OBJ_TYPE(
124124
stdio_obj_type,
125-
MP_QSTR_FileIO,
125+
MP_QSTR_StringIO,
126126
MP_TYPE_FLAG_ITER_IS_STREAM,
127127
print, stdio_obj_print,
128128
protocol, &stdio_obj_stream_p,
@@ -155,7 +155,7 @@ STATIC const mp_stream_p_t stdio_buffer_obj_stream_p = {
155155

156156
STATIC MP_DEFINE_CONST_OBJ_TYPE(
157157
stdio_buffer_obj_type,
158-
MP_QSTR_FileIO,
158+
MP_QSTR_StringIO,
159159
MP_TYPE_FLAG_ITER_IS_STREAM,
160160
print, stdio_obj_print,
161161
protocol, &stdio_buffer_obj_stream_p,

0 commit comments

Comments
 (0)
0