diff --git a/CHANGELOG b/CHANGELOG index 4bdf9dab1..f0a0e9e91 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -12,6 +12,8 @@ Changes between 1.0.0b3 and 1.0.0 * apply patch from Daniel Peolzleithner (issue #23) +* resolve issue #18, multiprocessing.Manager() and + redirection clash Changes between 1.0.0b1 and 1.0.0b3 ============================================= diff --git a/py/io/stdcapture.py b/py/io/stdcapture.py index eed9fb029..a43d4bf0e 100644 --- a/py/io/stdcapture.py +++ b/py/io/stdcapture.py @@ -136,9 +136,11 @@ class DontReadFromInput: readline = read readlines = read __iter__ = read - + + def fileno(self): + raise ValueError("redirected Stdin is pseudofile, has no fileno()") def isatty(self): - return False + return False try: devnullpath = os.devnull diff --git a/py/io/testing/test_stdcapture.py b/py/io/testing/test_stdcapture.py index e6cb8ea1f..5e857c5b2 100644 --- a/py/io/testing/test_stdcapture.py +++ b/py/io/testing/test_stdcapture.py @@ -1,6 +1,15 @@ import os, sys import py +def test_dontreadfrominput(): + from py.__.io.stdcapture import DontReadFromInput + f = DontReadFromInput() + assert not f.isatty() + py.test.raises(IOError, f.read) + py.test.raises(IOError, f.readlines) + py.test.raises(IOError, iter, f) + py.test.raises(ValueError, f.fileno) + class TestStdCapture: def getcapture(self, **kw): return py.io.StdCapture(**kw)