FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

bpo-18748: test_io: silence destructor errors by vstinner · Pull Request #12805 · python/cpython · GitHub

/ cpython Public

bpo-18748: test_io: silence destructor errors - #12805

Merged
vstinner merged 1 commit into
python:masterfrom
vstinner:test_io_destructor
Apr 12, 2019
Merged

bpo-18748: test_io: silence destructor errors#12805
vstinner merged 1 commit into
python:masterfrom
vstinner:test_io_destructor

Conversation

vstinner commented Apr 12, 2019
edited by bedevere-bot
Loading

Copy link
Copy Markdown
Member

vstinner commented Apr 12, 2019
edited
Loading

Copy link
Copy Markdown
Member Author

I tagged this PR as a WIP because it doesn't fix all issues:

test_reader_writer_close_error_on_close (test.test_io.CBufferedRWPairTest) ...
Exception ignored in: <_io.BufferedRWPair object at 0x7f4aa6fb2c50>
ValueError: flush of closed file
Exception ignored in: <_io.BufferedWriter>
ValueError: flush of closed file
ok

test_writer_close_error_on_close (test.test_io.CBufferedRWPairTest) ...
Exception ignored in: <_io.BufferedWriter>
ValueError: flush of closed file
ok

test_misbehaved_io (test.test_io.CBufferedRandomTest) ...
Exception ignored in: <_io.BufferedRandom>
OSError: Raw stream returned invalid position -123
Exception ignored in: <_io.BufferedRandom>
OSError: Raw stream returned invalid position -123
ok

test_write_non_blocking (test.test_io.CBufferedRandomTest) ...
Exception ignored in: <_io.BufferedRandom>
io.UnsupportedOperation: seek
ok

Remaining failures are related to CBufferedRWPairTest, but I'm not sure that it's a bug in the test or in io.BufferedRWPair. buffered_close() which doesn't call parent IOBase.close() method, wheareas _io_FileIO_close_impl() does call it. I'm always lost in the code base of the io module, so I can be wrong ;-)

The same test logs no exception with the pure Python implementation.

cc @pitrou @methane @serhiy-storchaka

vstinner changed the title [WIP] bpo-18748: test_io: silence destructor errors bpo-18748: test_io: silence destructor errors Apr 12, 2019

Copy link
Copy Markdown
Member Author

Hum. I started to see the "Exception ignored:" more and more often. I decided to merge this first fix. I will dig into the code for the strange CBufferedRWPairTest case.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL