Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-18748: _pyio.IOBase emits unraisable exception #13512

Merged
merged 3 commits into from
May 23, 2019
Merged

bpo-18748: _pyio.IOBase emits unraisable exception #13512

merged 3 commits into from
May 23, 2019

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented May 22, 2019

In development (-X dev) mode and in a debug build, IOBase finalizer
of the _pyio module now logs the exception if the close() method
fails. The exception is ignored silently by default in release build.

test_io: test_error_through_destructor() now uses
support.catch_unraisable_exception() rather than capturing stderr.

https://bugs.python.org/issue18748

In development (-X dev) mode and in a debug build, IOBase finalizer
of the _pyio module now logs the exception if the close() method
fails. The exception is ignored silently by default in release build.

test_io: test_error_through_destructor() now uses
support.catch_unraisable_exception() rather than capturing stderr.
@vstinner vstinner changed the title bpo-36918: _pyio.IOBase emits unraisable exception bpo-18748: _pyio.IOBase emits unraisable exception May 22, 2019
@vstinner
Copy link
Member Author

Ah, test_io failed on Travis CI. Example:

FAIL: test_error_through_destructor (test.test_io.CBufferedReaderTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/python/cpython/Lib/test/test_io.py", line 1107, in test_error_through_destructor
    self.assertIsNotNone(cm.unraisable)
AssertionError: unexpectedly None

@vstinner vstinner merged commit bc2aa81 into python:master May 23, 2019
@vstinner vstinner deleted the pyio_destructor branch May 23, 2019 01:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants