Issue 16598: Docs: double newlines printed in some file iteration examples (original) (raw)
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
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!