Skip to content

Conversation

kmvanbrunt
Copy link
Member

  • In an effort be consistent with the purpose of self.stdout and our own documentation, the following changes were made.
    • No longer redirecting sys.stdout.
    • No longer capturing pyscript output written to sys.stdout.
      • To assist with this change, calling print() within a pyscript now writes to self.stdout. Calling self.poutput() within a pyscript is still preferred, but that may not always be possible.

…n documentation, the following changes were made.

  - No longer redirecting sys.stdout.
  - No longer capturing pyscript output written to sys.stdout.
@kmvanbrunt kmvanbrunt requested a review from tleonhardt as a code owner July 21, 2025 04:49
Copy link

codecov bot commented Jul 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.41%. Comparing base (076d0e0) to head (5b41b0c).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1468      +/-   ##
==========================================
- Coverage   98.41%   98.41%   -0.01%     
==========================================
  Files          21       21              
  Lines        5863     5856       -7     
==========================================
- Hits         5770     5763       -7     
  Misses         93       93              
Flag Coverage Δ
unittests 98.41% <100.00%> (-0.01%) ⬇️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@tleonhardt tleonhardt left a comment

Choose a reason for hiding this comment

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

It isn't clear to me if it is better to do this or to eliminate self.stdout.

I think this is probably fine.

@kmvanbrunt
Copy link
Member Author

I'm going to close this and take a different approach. I will preserve redirecting sys.stdout, but only if it points to the same stream as self.stdout. That should be true in most cases, since the default behavior in setting self.stdout = sys.stdout.

@kmvanbrunt kmvanbrunt closed this Jul 21, 2025
@kmvanbrunt kmvanbrunt deleted the no_sys_stdout branch July 21, 2025 15:31
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.

2 participants