diff -r 7f30206d402f Lib/test/test_file.py --- a/Lib/test/test_file.py Tue Jan 06 12:39:45 2015 +0100 +++ b/Lib/test/test_file.py Tue Jan 06 12:42:04 2015 +0100 @@ -154,6 +154,22 @@ class OtherFileTests(unittest.TestCase): f.close() self.fail('%r is an invalid file mode' % mode) + def testStdinSeek(self): + if sys.platform == 'osf1V5': + # This causes the interpreter to exit on OSF1 v5.1. + self.skipTest('Skipping sys.stdin.seek(-1), it may crash ' + 'the interpreter. Test manually.') + + if not sys.stdin.isatty(): + # Issue #23168: if stdin is redirected to a file, stdin becomes + # seekable + self.skipTest('stdin must be a TTY in this test') + + self.assertRaises(IOError, sys.stdin.seek, -1) + + def testStdinTruncate(self): + self.assertRaises(IOError, sys.stdin.truncate) + def testBadModeArgument(self): # verify that we get a sensible error message for bad mode argument bad_mode = "qwerty"