]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
#12448: smtplib now flushes stdout while running ``python -m smtplib``
authorEzio Melotti <ezio.melotti@gmail.com>
Tue, 18 Oct 2011 10:20:07 +0000 (13:20 +0300)
committerEzio Melotti <ezio.melotti@gmail.com>
Tue, 18 Oct 2011 10:20:07 +0000 (13:20 +0300)
  in order to display the prompt correctly.  Patch by Petri Lehtinen.

Lib/smtplib.py
Misc/NEWS

index 13c56e196f8b4432591959ca53c4bef260706fe8..fbef96e691fa739e262d0d4ae3c26a73a5366dd3 100644 (file)
@@ -912,6 +912,7 @@ if __name__ == '__main__':
 
     def prompt(prompt):
         sys.stdout.write(prompt + ": ")
+        sys.stdout.flush()
         return sys.stdin.readline().strip()
 
     fromaddr = prompt("From")
index fbba9b1626ffb95ebcd6d3ebed82890442fd87ad..d610ff45f219aaa7bc63fb71c08b570f749b728e 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -47,6 +47,9 @@ Core and Builtins
 Library
 -------
 
+- Issue #12448: smtplib now flushes stdout while running ``python -m smtplib``
+  in order to display the prompt correctly.
+
 - Issue #13194: zlib.compressobj().copy() and zlib.decompressobj().copy() are
   now available on Windows.