Skip to content

Flush stdout on shutdown #5521

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

Open
arihant2math opened this issue Feb 14, 2025 · 4 comments
Open

Flush stdout on shutdown #5521

arihant2math opened this issue Feb 14, 2025 · 4 comments
Labels
C-compat A discrepancy between RustPython and CPython good first issue Good for newcomers

Comments

@arihant2math
Copy link
Collaborator

This is done in cpython, and an error is returned if the flush does not succeed.

@arihant2math arihant2math added the C-compat A discrepancy between RustPython and CPython label Feb 14, 2025
@pratheekhassan21
Copy link

hey,@arihant2math i thinking of contributing to rustpython.this will be my first contribution.can i work on this issue

@arihant2math
Copy link
Collaborator Author

@pratheekhassan21, sure, I think this is not a difficult issue. I think implementing Drop for a Stdout object in a manner that can't panic is the ideal implementation stragtegy. If not just creating a dummy object with a lifetime equivalent to the VM that flushes stdout on it's drop.

@arihant2math arihant2math added the good first issue Good for newcomers label Apr 25, 2025
@pratheekhassan21
Copy link

can u explain a little bit more in detail about the issue.As far as i understood if program is terminated it should call the flush before terminating?

@arihant2math
Copy link
Collaborator Author

The following test should be fixed if this is implemented:

def test_stdout_flush_at_shutdown(self):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-compat A discrepancy between RustPython and CPython good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants