From 09974b4e9e8da3c9ba0469f4812e68cf9f700ffd Mon Sep 17 00:00:00 2001 From: Andrew Svetlov Date: Sat, 8 Dec 2012 17:59:03 +0200 Subject: Drop double newlines printed in some file iteration examples. Patch by Steven Kryskalla. --- 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 index 53be499..2b76c32 100644 --- a/Doc/tutorial/errors.rst +++ b/Doc/tutorial/errors.rst @@ -387,7 +387,7 @@ succeeded or failed. Look at the following example, which tries to open a file 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 @@ used in a way that ensures they are always cleaned up promptly and correctly. :: 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 index 640287d..9e662f6 100644 --- a/Misc/ACKS +++ b/Misc/ACKS @@ -592,6 +592,7 @@ Cédric Krier Hannu Krosing Andrej Krpic Ivan Krstić +Steven Kryskalla Andrew Kuchling Dave Kuhlman Vladimir Kushnir -- cgit v0.12