Commits

Armin Rigo  committed ff186ed

Disable ReadlineInputStream for now. Needs thinking...

  • Participants
  • Parent commits 95dbd25

Comments (0)

Files changed (2)

File pypy/module/_file/test/test_file.py

             pass
         assert f.subclass_closed
 
+    def test_readline_unbuffered_should_read_one_line_only(self):
+        import posix
+
+        with self.file(self.temppath, 'w') as f:
+            f.write('foo\nbar\n')
+
+        with self.file(self.temppath, 'r', 0) as f:
+            s = f.readline()
+            assert s == 'foo\n'
+            s = posix.read(f.fileno(), 10)
+            assert s == 'bar\n'
+
 def test_flush_at_exit():
     from pypy import conftest
     from pypy.tool.option import make_config, make_objspace

File pypy/rlib/streamio.py

 def construct_stream_tower(stream, buffering, universal, reading, writing,
                            binary):
     if buffering == 0:   # no buffering
-        if reading:      # force some minimal buffering for readline()
-            stream = ReadlineInputStream(stream)
+        # XXX we cannot really use ReadlineInputStream: see module/_file/
+        # test/test_file.py:test_readline_unbuffered_should_read_one_line_only
+        pass
+        #if reading:      # force some minimal buffering for readline()
+        #    stream = ReadlineInputStream(stream)
     elif buffering == 1:   # line-buffering
         if writing:
             stream = LineBufferingOutputStream(stream)