Author: Armin Rigo <[email protected]>
Branch:
Changeset: r57822:ff186eda82f9
Date: 2012-10-07 17:17 +0200
http://bitbucket.org/pypy/pypy/changeset/ff186eda82f9/
Log: Disable ReadlineInputStream for now. Needs thinking...
diff --git a/pypy/module/_file/test/test_file.py
b/pypy/module/_file/test/test_file.py
--- a/pypy/module/_file/test/test_file.py
+++ b/pypy/module/_file/test/test_file.py
@@ -428,6 +428,18 @@
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
diff --git a/pypy/rlib/streamio.py b/pypy/rlib/streamio.py
--- a/pypy/rlib/streamio.py
+++ b/pypy/rlib/streamio.py
@@ -141,8 +141,11 @@
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)
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit