Skip to content

Commit b87630c

Browse files
committed
Issue #21860: Correct docstrings of FileIO.seek() and FileIO.truncate() methods.
Patch by Terry Chia.
1 parent 717b0d3 commit b87630c

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

Misc/ACKS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@ Nicolas Chauvat
237237
Jerry Chen
238238
Michael Chermside
239239
Ingrid Cheung
240+
Terry Chia
240241
Albert Chin-A-Young
241242
Adal Chiriliuc
242243
Matt Chisholm

Modules/_io/fileio.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1124,7 +1124,8 @@ PyDoc_STRVAR(fileno_doc,
11241124
"This is needed for lower-level file interfaces, such the fcntl module.");
11251125

11261126
PyDoc_STRVAR(seek_doc,
1127-
"seek(offset: int[, whence: int]) -> None. Move to new file position.\n"
1127+
"seek(offset: int[, whence: int]) -> int. Move to new file position and\n"
1128+
"return the file position.\n"
11281129
"\n"
11291130
"Argument offset is a byte count. Optional argument whence defaults to\n"
11301131
"0 (offset from start of file, offset should be >= 0); other values are 1\n"
@@ -1136,9 +1137,10 @@ PyDoc_STRVAR(seek_doc,
11361137

11371138
#ifdef HAVE_FTRUNCATE
11381139
PyDoc_STRVAR(truncate_doc,
1139-
"truncate([size: int]) -> None. Truncate the file to at most size bytes.\n"
1140+
"truncate([size: int]) -> int. Truncate the file to at most size bytes\n"
1141+
"and return the truncated size.\n"
11401142
"\n"
1141-
"Size defaults to the current file position, as returned by tell()."
1143+
"Size defaults to the current file position, as returned by tell().\n"
11421144
"The current file position is changed to the value of size.");
11431145
#endif
11441146

0 commit comments

Comments
 (0)