[issue14853] test_file.py depends on sys.stdin being unseekable

Gregory P. Smith report at bugs.python.org
Fri May 18 20:50:07 CEST 2012


New submission from Gregory P. Smith <greg at krypto.org>:

./python Lib/test/test_file.py    # passes
./python Lib/test/test_file.py </dev/null   # fails
nohup ./python Lib/test/test_file.py   # fails


======================================================================
FAIL: testStdin (__main__.COtherFileTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "Lib/test/test_file.py", line 160, in testStdin
    self.assertRaises((IOError, ValueError), sys.stdin.seek, -1)
AssertionError: (<type 'exceptions.IOError'>, <type 'exceptions.ValueError'>) not raised

======================================================================
FAIL: testStdin (__main__.PyOtherFileTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "Lib/test/test_file.py", line 160, in testStdin
    self.assertRaises((IOError, ValueError), sys.stdin.seek, -1)
AssertionError: (<type 'exceptions.IOError'>, <type 'exceptions.ValueError'>) not raised


2.7 only; works fine in 3.2.

----------
keywords: easy
messages: 161073
nosy: gregory.p.smith
priority: normal
severity: normal
status: open
title: test_file.py depends on sys.stdin being unseekable
type: behavior
versions: Python 2.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue14853>
_______________________________________


More information about the Python-bugs-list mailing list