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

[live] Restore sys.stderr when an exception happens during a refresh #2305

Merged
merged 1 commit into from
May 27, 2022

Conversation

olivierphi
Copy link

Without this the user sees no error displayed in their terminal - and even capturing the exception and displayed their own error reporting is ineffective.

Type of changes

  • Bug fix
  • New feature
  • Documentation / docstrings
  • Tests
  • Other

Checklist

  • I've run the latest black with default args on new code.
  • I've updated CHANGELOG.md and CONTRIBUTORS.md where appropriate.
  • I've added tests for new code.
  • I accept that @willmcgugan may be pedantic in the code review.

Description

fixes #2291

Without this the user sees no error displayed in their terminal - and even capturing the exception and displayed their own error reporting is ineffective.
@olivierphi olivierphi force-pushed the fix-invalid-markup-crash branch from d570d94 to cf99a8d Compare May 27, 2022 11:04
@codecov-commenter
Copy link

codecov-commenter commented May 27, 2022

Codecov Report

Merging #2305 (cf99a8d) into master (14d47c9) will decrease coverage by 0.12%.
The diff coverage is 94.26%.

@@            Coverage Diff             @@
##           master    #2305      +/-   ##
==========================================
- Coverage   98.88%   98.76%   -0.13%     
==========================================
  Files          73       73              
  Lines        7629     7676      +47     
==========================================
+ Hits         7544     7581      +37     
- Misses         85       95      +10     
Flag Coverage Δ
unittests 98.76% <94.26%> (-0.13%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
rich/_export_format.py 100.00% <ø> (ø)
rich/live.py 97.90% <40.00%> (-2.10%) ⬇️
rich/console.py 98.29% <96.03%> (-0.49%) ⬇️
rich/syntax.py 99.30% <100.00%> (+0.02%) ⬆️
rich/terminal_theme.py 100.00% <100.00%> (ø)
rich/traceback.py 98.68% <0.00%> (-0.88%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update aa7926c...cf99a8d. Read the comment docs.

@olivierphi olivierphi marked this pull request as ready for review May 27, 2022 11:09
Copy link
Collaborator

@willmcgugan willmcgugan left a comment

Choose a reason for hiding this comment

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

LGTM Will add a issue for the general case of refresh failing after start.

@willmcgugan willmcgugan merged commit 5ccf4ed into master May 27, 2022
@willmcgugan willmcgugan deleted the fix-invalid-markup-crash branch May 27, 2022 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Invalid markup in a ProgressBar causes the entire Python script to exit abnormally.
3 participants