Issue 22069: TextIOWrapper(newline="\n", line_buffering=True) mistakenly treat \r as a newline (original) (raw)

Issue22069

Created on 2014-07-25 16:43 by akira, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 6609 merged Elena.Oat,2018-04-26 10:25
PR 6801 merged miss-islington,2018-05-14 14:49
PR 6802 merged miss-islington,2018-05-14 14:50
PR 6803 merged miss-islington,2018-05-14 14:51
Messages (8)
msg223965 - (view) Author: Akira Li (akira) * Date: 2014-07-25 16:43
TextIOWrapper(b, newline="\n", line_buffering=True) object calls flush() while writing "\r". See test_line_buffering() method in Lib/test/test_io.py:2114 The documentation says [1]: > If line_buffering is True, flush() is implied when a call to write contains > a newline character. i.e., writing \r shouldn't force flush() if newline="\n" [1] https://docs.python.org/3.4/library/io.html#io.TextIOWrapper
msg224078 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2014-07-26 17:11
Looks as this behavior is intentional. Documentation should be corrected.
msg315785 - (view) Author: Elena Oat (Elena.Oat) * Date: 2018-04-26 10:12
Note that the correct link to the test case is: https://github.com/python/cpython/blob/master/Lib/test/test_io.py#L2565
msg316513 - (view) Author: Mariatta (Mariatta) * (Python committer) Date: 2018-05-14 14:48
New changeset 7ffd4c58fae08b29259eebd6cbcd2287820b14e8 by Mariatta (Elena Oat) in branch 'master': bpo-22069: Update TextIO documentation (GH-6609) https://github.com/python/cpython/commit/7ffd4c58fae08b29259eebd6cbcd2287820b14e8
msg316528 - (view) Author: miss-islington (miss-islington) Date: 2018-05-14 16:08
New changeset 050e041bf7e5260013a74c75a05a3f0fb16447ec by Miss Islington (bot) in branch '3.7': bpo-22069: Update TextIO documentation (GH-6609) https://github.com/python/cpython/commit/050e041bf7e5260013a74c75a05a3f0fb16447ec
msg316529 - (view) Author: miss-islington (miss-islington) Date: 2018-05-14 16:11
New changeset 84fc6c59cf286fc4e6b3a700c6db36ecc2bff92b by Miss Islington (bot) in branch '2.7': bpo-22069: Update TextIO documentation (GH-6609) https://github.com/python/cpython/commit/84fc6c59cf286fc4e6b3a700c6db36ecc2bff92b
msg316530 - (view) Author: miss-islington (miss-islington) Date: 2018-05-14 16:18
New changeset 9fd5b5fdf851d35a5c1314360119850e86a1fd0d by Miss Islington (bot) in branch '3.6': bpo-22069: Update TextIO documentation (GH-6609) https://github.com/python/cpython/commit/9fd5b5fdf851d35a5c1314360119850e86a1fd0d
msg316534 - (view) Author: Mariatta (Mariatta) * (Python committer) Date: 2018-05-14 16:25
Thanks!
History
Date User Action Args
2022-04-11 14:58:06 admin set github: 66267
2018-05-14 16:25:15 Mariatta set resolution: fixed
2018-05-14 16:25:06 Mariatta set status: open -> closedstage: patch review -> resolvedmessages: + versions: + Python 2.7, Python 3.6
2018-05-14 16🔞27 pitrou set nosy: - pitrou
2018-05-14 16🔞09 miss-islington set messages: +
2018-05-14 16:11:44 miss-islington set messages: +
2018-05-14 16:08:59 miss-islington set nosy: + miss-islingtonmessages: +
2018-05-14 14:51:13 miss-islington set pull_requests: + <pull%5Frequest6487>
2018-05-14 14:50:16 miss-islington set pull_requests: + <pull%5Frequest6486>
2018-05-14 14:49:14 miss-islington set pull_requests: + <pull%5Frequest6485>
2018-05-14 14:48:03 Mariatta set nosy: + Mariattamessages: +
2018-04-26 10:25:07 Elena.Oat set keywords: + patchstage: needs patch -> patch reviewpull_requests: + <pull%5Frequest6305>
2018-04-26 10:12:59 Elena.Oat set nosy: + Elena.Oatmessages: +
2018-04-25 17:22:17 cheryl.sabella set keywords: + easystage: needs patchversions: + Python 3.7, Python 3.8, - Python 2.7, Python 3.4, Python 3.5
2014-07-26 17:11:57 serhiy.storchaka set nosy: + hynek, stutzbach, benjamin.peterson, pitrou, docs@pythonmessages: + assignee: docs@pythoncomponents: + Documentation
2014-07-26 17:00:59 serhiy.storchaka set nosy: + serhiy.storchaka
2014-07-25 16:43:43 akira create