AssertionError when cancelling a test

Create issue
Issue #96 resolved
Amaury Forgeot d'Arc created an issue

I got this traceback when pressing Ctrl-C. This happens from time to time, and there is not line "!!! KEYBOARD INTERRUPT !!!"

{{{ module\cpyext\test\ .......... module\cpyext\test\ Traceback (most recent call last): File "C:\dev\pypy\trunk\pypy\", line 6, in ? py.cmdline.pytest() File "C:\dev\pypy\trunk\py_test\", line 17, in main exitstatus = session.main(colitems) File "C:\dev\pypy\trunk\py_test\", line 113, in main self.config.hook.pytest_keyboard_interrupt(excinfo=excinfo) File "C:\dev\pypy\trunk\py_test\", line 347, in call return self.hookrelay._performcall(, mc) File "C:\dev\pypy\trunk\py_test\", line 333, in _performcall return multicall.execute() File "C:\dev\pypy\trunk\py_test\", line 244, in execute res = method(**kwargs) File "C:\dev\pypy\trunk\py_plugin\", line 232, in pytest_keyboard_interrupt self.suspendcapture() File "C:\dev\pypy\trunk\py_plugin\", line 170, in suspendcapture outerr = cap.suspend() File "C:\dev\pypy\trunk\py_io\", line 166, in suspend assert not hasattr(self, '_suspended') py._code.assertion.AssertionError: assert not hasattr(<py._io.capture.StdCaptureFD object at 0x01AC9250>, '_suspended') }}}

Comments (4)

  1. Amaury Forgeot d'Arc reporter
    • changed status to open

    thats actually looking like a semantic bug in hasattr of cpython

    Can you elaborate? it's possible that the break occurred inside a regular call to suspendcapture(), before "del self._capturing". In this case suspendcapture() is called twice.

  2. Holger Krekel repo owner

    hi amaury,

    you are right - capturing and KeyboardInterrupt are not completely safe. There are several areas that are vulnerable, unfortunately. I'll look into it. holger

  3. Log in to comment