GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — bpo-18748: test_io: silence destructor errors by vstinner · Pull Request #12805 · python/cpython

Conversation

@vstinner

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

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

https://bugs.python.org/issue18748

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@vstinner
bpo-18748: test_io: silence destructor errors
8031ffb
@vstinner vstinner added skip news DO-NOT-MERGE labels Apr 12, 2019
@the-knights-who-say-ni the-knights-who-say-ni added the CLA signed label Apr 12, 2019
@bedevere-bot bedevere-bot added tests Tests in the Lib/test dir awaiting core review labels Apr 12, 2019
@vstinner

vstinner commented Apr 12, 2019 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vstinner vstinner changed the title [WIP] bpo-18748: test_io: silence destructor errors bpo-18748: test_io: silence destructor errors Apr 12, 2019
@vstinner vstinner removed the DO-NOT-MERGE label Apr 12, 2019
@vstinner

vstinner commented 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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vstinner
vstinner merged commit 472f794 into python:master Apr 12, 2019
@bedevere-bot bedevere-bot removed the awaiting core review label Apr 12, 2019
@vstinner
vstinner deleted the test_io_destructor branch April 12, 2019 19:58
@ionelmc ionelmc mannequin mentioned this pull request Apr 10, 2022
io.IOBase destructor silence I/O error on close() by default #62948
Closed
@bedevere-bot bedevere-bot added the awaiting core review label Aug 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

awaiting core review skip news tests Tests in the Lib/test dir

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@vstinner @the-knights-who-say-ni @bedevere-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.