This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ocean-city
Recipients ocean-city, pitrou, r_mosaic
Date 2009-03-18.16:55:20
SpamBayes Score 9.724642e-07
Marked as misclassified No
Message-id <1237395323.93.0.583064992345.issue5505@psf.upfronthosting.co.za>
In-reply-to
Content
With following patch for investigation, (release30-maint)

Index: Lib/io.py
===================================================================
--- Lib/io.py	(revision 70450)
+++ Lib/io.py	(working copy)
@@ -57,6 +57,7 @@
 
 import os
 import abc
+import sys
 import codecs
 import _fileio
 # Import _thread instead of threading to reduce startup cost
@@ -931,6 +932,7 @@
             while True:
                 # Read until EOF or until read() would block.
                 chunk = self.raw.read()
+                print("============>", repr(chunk), file=sys.stderr)
                 if chunk in empty_values:
                     nodata_val = chunk
                     break

///////////////////////

I got this result.

>>> sys.stdin.read()
abc
^Z
============> b'abc\n'
^Z
============> b''
'abc\n'

To get empty chunk, we need to hit CTRL-Z twice.
History
Date User Action Args
2009-03-18 16:55:24ocean-citysetrecipients: + ocean-city, pitrou, r_mosaic
2009-03-18 16:55:23ocean-citysetmessageid: <1237395323.93.0.583064992345.issue5505@psf.upfronthosting.co.za>
2009-03-18 16:55:21ocean-citylinkissue5505 messages
2009-03-18 16:55:20ocean-citycreate