[issue17976] file.write doesn't raise IOError when it should

STINNER Victor report at bugs.python.org
Fri May 17 22:42:59 CEST 2013


STINNER Victor added the comment:

Attached: Test expressed as an unit test, test_dev_null.py.

The test pass with Python 3 which does not use the "FILE*" API anymore. So you should maybe migrate to Python 3 :-)


$ python3.4 test_dev_null.py
..
----------------------------------------------------------------------
Ran 2 tests in 0.005s

OK


$ python2.7 test_dev_null.py
.F
======================================================================
FAIL: test_write2 (__main__.TestFull)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_dev_null.py", line 13, in test_write2
    self.assertRaises(IOError, self.check_write, 'hello', '\n')
AssertionError: IOError not raised

----------------------------------------------------------------------
Ran 2 tests in 0.002s

FAILED (failures=1)

----------
nosy: +haypo
Added file: http://bugs.python.org/file30302/test_dev_null.py

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


More information about the Python-bugs-list mailing list