Skip to content

Flush output in Python before running execvp #2258

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

Merged
merged 1 commit into from
Mar 21, 2025

Conversation

mathbunnyru
Copy link
Member

Describe your changes

Issue ticket if applicable

Checklist (especially for first-time contributors)

  • I have performed a self-review of my code
  • If it is a core feature, I have added thorough tests
  • I will try not to use force-push to make the review process easier for reviewers
  • I have updated the documentation for significant changes

@@ -40,5 +41,5 @@
command += sys.argv[1:]

# Execute the command!
print("Executing: " + " ".join(command))
print("Executing: " + " ".join(command), flush=True)
Copy link
Member Author

@mathbunnyru mathbunnyru Mar 21, 2025

Choose a reason for hiding this comment

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

I think what was going on without TTY is that the output was buffered and this buffer was lost and not flushed, so the test was failing.

Adding flush allows us to write a test without a tty (the lost output is required in the test)

@mathbunnyru mathbunnyru merged commit 929ebdb into jupyter:main Mar 21, 2025
96 checks passed
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.

1 participant