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

ensure PYTHONUNBUFFERED=1 #14

Open
tkittel opened this issue Nov 6, 2023 · 0 comments
Open

ensure PYTHONUNBUFFERED=1 #14

tkittel opened this issue Nov 6, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@tkittel
Copy link
Member

tkittel commented Nov 6, 2023

We already set PYTHONUNBUFFERED=1 when launching unit tests, but user output might also get scrambled if not set. Should we let simplebuild --env-setup handle this as well? Main issue is that:

eval "$(simplebuild --env-setup)"
export PYTHONUNBUFFERED=1
eval "$(simplebuild --env-unsetup)"

Might leave PYTHONUNBUFFERED=0 despite what the user asked for in line 2.

Another solution might simply be to set and never unset PYTHONUNBUFFERED=1.

Finally, we could read the spec carefully:

PYTHONUNBUFFERED
If this is set to a non-empty string it is equivalent to specifying the -u option.

Which gives us leeway to not only set the variable, but also add our signature. Perhaps we can store the old value of PYTHONUNBUFFERED, and set our own value to something recognisable (e.g. enabled-by-simplebuild). If the value remains at --env-unsetup time, we can restore the original value.

@tkittel tkittel added enhancement New feature or request and removed not_urgent labels Jan 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant