diff options
author | Martin Panter <vadmium+py@gmail.com> | 2015-10-10 03:01:20 (GMT) |
---|---|---|
committer | Martin Panter <vadmium+py@gmail.com> | 2015-10-10 03:01:20 (GMT) |
commit | cfad54344f570c1e833d92289ac571da7315b164 (patch) | |
tree | fe27ffbbeac5a45428586ef8ab97409971a42bf7 /Modules | |
parent | e44dba3b4f9371be10c0b9414e6401a4d95184d5 (diff) | |
download | cpython-cfad54344f570c1e833d92289ac571da7315b164.zip cpython-cfad54344f570c1e833d92289ac571da7315b164.tar.gz cpython-cfad54344f570c1e833d92289ac571da7315b164.tar.bz2 |
Issue #22413: Document newline effect on StringIO initializer and getvalue
Also add to comment in the C code.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_io/_iomodule.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Modules/_io/_iomodule.h b/Modules/_io/_iomodule.h index 8927864..140f260 100644 --- a/Modules/_io/_iomodule.h +++ b/Modules/_io/_iomodule.h @@ -52,7 +52,12 @@ extern PyObject *_PyIncrementalNewlineDecoder_decode( which can be safely put aside until another search. NOTE: for performance reasons, `end` must point to a NUL character ('\0'). - Otherwise, the function will scan further and return garbage. */ + Otherwise, the function will scan further and return garbage. + + There are three modes, in order of priority: + * translated: Only find \n (assume newlines already translated) + * universal: Use universal newlines algorithm + * Otherwise, the line ending is specified by readnl, a str object */ extern Py_ssize_t _PyIO_find_line_ending( int translated, int universal, PyObject *readnl, int kind, char *start, char *end, Py_ssize_t *consumed); |