[Python-checkins] cpython (merge 3.2 -> 3.3): Drop double newlines printed in some file iteration examples.

andrew.svetlov python-checkins at python.org
Sat Dec 8 17:01:39 CET 2012


http://hg.python.org/cpython/rev/268ead8ae46b
changeset:   80756:268ead8ae46b
branch:      3.3
parent:      80753:3345afd6dc61
parent:      80755:fed7306f26ce
user:        Andrew Svetlov <andrew.svetlov at gmail.com>
date:        Sat Dec 08 17:59:23 2012 +0200
summary:
  Drop double newlines printed in some file iteration examples.

Patch by Steven Kryskalla.

files:
  Doc/tutorial/errors.rst |  4 ++--
  Misc/ACKS               |  1 +
  2 files changed, 3 insertions(+), 2 deletions(-)


diff --git a/Doc/tutorial/errors.rst b/Doc/tutorial/errors.rst
--- a/Doc/tutorial/errors.rst
+++ b/Doc/tutorial/errors.rst
@@ -387,7 +387,7 @@
 and print its contents to the screen. ::
 
    for line in open("myfile.txt"):
-       print(line)
+       print(line, end="")
 
 The problem with this code is that it leaves the file open for an indeterminate
 amount of time after this part of the code has finished executing.
@@ -397,7 +397,7 @@
 
    with open("myfile.txt") as f:
        for line in f:
-           print(line)
+           print(line, end="")
 
 After the statement is executed, the file *f* is always closed, even if a
 problem was encountered while processing the lines. Objects which, like files,
diff --git a/Misc/ACKS b/Misc/ACKS
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -653,6 +653,7 @@
 Hannu Krosing
 Andrej Krpic
 Ivan Krstić
+Steven Kryskalla
 Andrew Kuchling
 Dave Kuhlman
 Jon Kuhn

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list