Skip to content

Support stderr #33

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 8 commits into from
Apr 28, 2025
Merged

Support stderr #33

merged 8 commits into from
Apr 28, 2025

Conversation

pkhalaj
Copy link
Contributor

@pkhalaj pkhalaj commented Apr 25, 2025

No description provided.

@pkhalaj pkhalaj marked this pull request as ready for review April 25, 2025 11:57
Copy link
Member

@mraspaud mraspaud left a comment

Choose a reason for hiding this comment

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

Looks good, just a couple of questions inline.

out, err = process.communicate()
logger.debug(f"After having run the script: [stdout]{out} [stderr]{err}")
if err:
return out + err
Copy link
Member

Choose a reason for hiding this comment

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

Would it hurt to remove the "if" and always return out + err?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

Comment on lines 69 to 71
@pytest.fixture(params=[False, True])
def dumped_to_std_err(request):
return request.param
Copy link
Member

Choose a reason for hiding this comment

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

Really nice with request.param, works well for this use case!
One thing though: I think it might be even better to use eg sys.stdout and sys.stderr as values here. In which case, the fixture should probably change name, eg "output_stream"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

@mraspaud
Copy link
Member

also, pre-commit isn’t happy.

@pkhalaj pkhalaj requested a review from mraspaud April 25, 2025 13:29
@pkhalaj pkhalaj force-pushed the feature/support-std-error branch from f7172b6 to 8c33b86 Compare April 25, 2025 13:33
Copy link
Member

@mraspaud mraspaud left a comment

Choose a reason for hiding this comment

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

LGTM

@mraspaud mraspaud merged commit a06266c into pytroll:main Apr 28, 2025
4 checks passed
@mraspaud mraspaud added the bug Something isn't working label Apr 28, 2025
@pkhalaj pkhalaj deleted the feature/support-std-error branch April 28, 2025 10:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants