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-36829: Document test.support.catch_unraisable_exception() by vstinner · Pull Request #13554 · python/cpython

Conversation

@vstinner

@vstinner vstinner commented May 24, 2019 •
edited by bedevere-bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

catch_unraisable_exception() now also removes its 'unraisable'
attribute at the context manager exit.

https://bugs.python.org/issue36829

Sorry, something went wrong.

Uh oh!

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

All reactions
@the-knights-who-say-ni the-knights-who-say-ni added the CLA signed label May 24, 2019
@bedevere-bot bedevere-bot added the awaiting core review label May 24, 2019
@vstinner vstinner added the skip news label May 24, 2019
@vstinner vstinner mentioned this pull request May 24, 2019
bpo-36829: Add test.support.catch_unraisable_exception() #13490
Merged
@vstinner

vstinner commented May 24, 2019

Copy link
Copy Markdown
Member Author

cc @tirkarthi @graingert

All reactions

Sorry, something went wrong.

Uh oh!

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

graingert
graingert reviewed May 24, 2019
View reviewed changes
Comment thread Doc/library/test.rst Outdated

@graingert graingert May 24, 2019

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be worth suggesting gc.collect()

Sorry, something went wrong.

Uh oh!

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

All reactions

@vstinner vstinner May 24, 2019

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gc.collect() is not needed. Why do you want to force a GC collection?

Sorry, something went wrong.

Uh oh!

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

All reactions

@graingert graingert May 24, 2019

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not needed but it's often a good trigger of these sort of exceptions

Sorry, something went wrong.

Uh oh!

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

All reactions

@vstinner vstinner May 24, 2019

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, tests using the context manager expect an unraisable exception and fail if it's not the case.

Sorry, something went wrong.

Uh oh!

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

All reactions

@vstinner vstinner May 24, 2019

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh. By the way. I also had the idea of installing a custom sys.unraisablehook in regrtest and repeat all errors at exit. Maybe even make the test fail if at least one unraisable exception is logged.

Sorry, something went wrong.

Uh oh!

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

All reactions

@graingert graingert May 24, 2019

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you URL me to that commit?

Sorry, something went wrong.

Uh oh!

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

All reactions

@vstinner vstinner May 24, 2019

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not a commit but an idea :-) I didn't implement it.

Sorry, something went wrong.

Uh oh!

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

All reactions

@graingert graingert May 24, 2019

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, :$ ping me when implemented!

Sorry, something went wrong.

Uh oh!

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

All reactions
@vstinner

vstinner commented May 24, 2019

Copy link
Copy Markdown
Member Author

Oh. "del self.unraisable" was a good idea. I only used the context manager in a few places, but I already get it wrong in test_io :-) It's now fixed by this PR!

All reactions

Sorry, something went wrong.

Uh oh!

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

tirkarthi
tirkarthi reviewed May 24, 2019
View reviewed changes
Comment thread Doc/library/test.rst Resolved

Uh oh!

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

graingert
graingert reviewed May 24, 2019
View reviewed changes
Comment thread Lib/test/test_io.py Resolved

Uh oh!

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

@vstinner
bpo-36829: Document test.support.catch_unraisable_exception()
dc0dc43
catch_unraisable_exception() now also removes its 'unraisable'
attribute at the context manager exit.
@vstinner

vstinner commented May 24, 2019

Copy link
Copy Markdown
Member Author

@tirkarthi @graingert: Would you mind to review the updated PR?

All reactions

Sorry, something went wrong.

Uh oh!

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

graingert
graingert approved these changes May 24, 2019
View reviewed changes
@vstinner
vstinner merged commit 6dbbe74 into python:master May 24, 2019
@bedevere-bot bedevere-bot removed the awaiting core review label May 24, 2019
@vstinner

vstinner commented May 24, 2019

Copy link
Copy Markdown
Member Author

@graingert: Thanks for your very good feedback, it's very valuable!

All reactions

Sorry, something went wrong.

Uh oh!

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

@vstinner
vstinner deleted the catch_unraisable2 branch May 24, 2019 22:09
DinoV pushed a commit to DinoV/cpython that referenced this pull request Jan 14, 2020
@vstinner @DinoV
bpo-36829: Document test.support.catch_unraisable_exception() (python…
d45fd12
…GH-13554)

catch_unraisable_exception() now also removes its 'unraisable'
attribute at the context manager exit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@tirkarthi tirkarthi tirkarthi left review comments
@graingert graingert graingert approved these changes

Uh oh!

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

Assignees

No one assigned

Labels

skip news

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.

5 participants

@vstinner @graingert @tirkarthi @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.