[issue16598] Docs: double newlines printed in some file iteration examples

New submission from Steven Kryskalla: I heard someone complain about this code appearing in the official documentation in a few places: for line in open("file.txt"): print(line) This code will print two newlines. I went through the current "default" and "2.7" branches and changed the places where this occurred to use print(line, end="") for 3.x or "print line," for 2.x. r80699.patch is for the "default" branch (3.x) r80694.py27.patch is for the "2.7" branch ---------- assignee: docs@python components: Documentation files: r80699.patch hgrepos: 164 keywords: patch messages: 176824 nosy: docs@python, lost-theory priority: normal severity: normal status: open title: Docs: double newlines printed in some file iteration examples type: enhancement versions: Python 3.3, Python 3.4, Python 3.5 Added file: http://bugs.python.org/file28191/r80699.patch _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue16598> _______________________________________

Changes by Steven Kryskalla <skryskalla@gmail.com>: ---------- versions: +Python 2.7 Added file: http://bugs.python.org/file28192/r80699.patch _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue16598> _______________________________________

Changes by Steven Kryskalla <skryskalla@gmail.com>: Removed file: http://bugs.python.org/file28192/r80699.patch _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue16598> _______________________________________

Changes by Steven Kryskalla <skryskalla@gmail.com>: Added file: http://bugs.python.org/file28193/r80694.py27.patch _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue16598> _______________________________________

Changes by Terry J. Reedy <tjreedy@udel.edu>: ---------- nosy: +terry.reedy _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue16598> _______________________________________

Andrew Svetlov added the comment: Committed, except whatsnew files. That ones should be untouched from my perspective — the issue is not bugfix but improvement and I see no reason why we need to backedit whatsnew for old outdated versions. Changesetes fed7306f26ce, 268ead8ae46b, 9e4b003a4d7a, 29627bd5b333. Thanks for patches! ---------- nosy: +asvetlov resolution: -> fixed stage: -> committed/rejected status: open -> closed _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue16598> _______________________________________
participants (3)
-
Andrew Svetlov
-
Steven Kryskalla
-
Terry J. Reedy