File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -1052,8 +1052,12 @@ Text I/O
10521052
10531053 The initial value of the buffer can be set by providing *initial_value *.
10541054 If newline translation is enabled, newlines will be encoded as if by
1055- :meth: `~TextIOBase.write `. The stream is positioned at the start of
1056- the buffer.
1055+ :meth: `~TextIOBase.write `. The stream is positioned at the start of the
1056+ buffer which emulates opening an existing file in a `w+ ` mode, making it
1057+ ready for an immediate write from the beginning or for a write that
1058+ would overwrite the initial value. To emulate opening a file in an `a+ `
1059+ mode ready for appending, use `f.seek(0, io.SEEK_END) ` to reposition the
1060+ stream at the end of the buffer.
10571061
10581062 The *newline * argument works like that of :class: `TextIOWrapper `,
10591063 except that when writing output to the stream, if *newline * is ``None ``,
You can’t perform that action at this time.
0 commit comments