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

bootloader: use Py_UnbufferedStdioFlag to enable unbuffered output #5597

Merged
merged 2 commits into from Mar 7, 2021

Conversation

rokm
Copy link
Member

@rokm rokm commented Mar 2, 2021

Setting Py_UnbufferedStdioFlag enables unbuffered stdio mode in the Python library.

This enables unbuffered binary layer of stdout and stderr streams in all supported Python versions, while unbuffered text layer requires Python 3.7 or later.

Closes #1441.

rokm added 2 commits March 2, 2021 12:54
The frozen script periodically prints * character to a single
line on the specified output stream (stdout or stderr) in either
text or binary mode. Once the selected number of characters have
been printed, end-of-transmission is signalled by 'E' character.

The test itself is asynchronously reading the output of the spawned
frozen script, and counting the recived * characters as long as
the received buffer ends with *. In buffered mode, the whole
E-terminated line is exepected to be received at once, while in
unbuffered mode, each * character is expected to be received
separately.
Setting Py_UnbufferedStdioFlag enables unbuffered stdio mode in
the Python library. This enables unbuffered binary layer of
stdout and stderr streams in all supported Python versions, while
unbuffered text layer requires Python 3.7 or later.
@rokm rokm marked this pull request as ready for review March 2, 2021 22:19
Copy link
Member

@Legorooj Legorooj left a comment

Choose a reason for hiding this comment

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

Amazing work!

@Legorooj Legorooj requested review from bwoodsend and removed request for bwoodsend March 7, 2021 03:39
@Legorooj Legorooj merged commit d690f9d into pyinstaller:develop Mar 7, 2021
@rokm rokm deleted the unbuffered-stdio branch March 22, 2021 19:39
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Examine handling of u option (Unbuffered stdio)
2 participants