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
fix: Prevent binary log files to crash snakemake execution with show-failed-logs
#2827
fix: Prevent binary log files to crash snakemake execution with show-failed-logs
#2827
Conversation
show-failed-logs
show-failed-logs
2deb30a
to
2f25c1a
Compare
show-failed-logs
show-failed-logs
2f25c1a
to
4b7a9cc
Compare
This replicates snakemake#2826 Unfortunately this test seems to currently crush the pytest test execution when failing. Given that it should not fail any more I think this may be acceptable.
Previously a binary log file would cause `show_logs` to crash the whole snakemake workflow execution with a `UnicodeDecodeError`. Closes snakemake#2826
4b7a9cc
to
7bddc8e
Compare
Quality Gate passedIssues Measures |
@test: I am not extremely happy about the test: currently the test is more on the integration test level, so I think it may be better to also add a unittest for |
Sure, a follow-up PR in that direction would be appreciated. Maybe it would need synchronization with #2830 |
🤖 I have created a release *beep* *boop* --- ## [8.11.1](v8.11.0...v8.11.1) (2024-04-29) ### Bug Fixes * check template rendering output for leaked input file paths ([#2850](#2850)) ([433302e](433302e)) * do not distinguish between local and remote rules in dryrun ([74b99ec](74b99ec)) * omit norun jobs when determining remote storage input file retrieval ([#2854](#2854)) ([37a7c7f](37a7c7f)) * Prevent binary log files to crash snakemake execution with `show-failed-logs` ([#2827](#2827)) ([8a80bda](8a80bda)) * replace pkg_resources for python 3.12 ([#2831](#2831)) ([ac144fc](ac144fc)) * return set instead of list when just --quiet ([#2829](#2829)) ([eeb57e2](eeb57e2)) * small typo in error ([#2853](#2853)) ([325a715](325a715)) * use keyword arguments in `_IOFile.open` ([#2847](#2847)) ([50c84dc](50c84dc)) ### Documentation * fix typo and link for RO Crate ([#2851](#2851)) ([cec0041](cec0041)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Description
As described in #2826 currently the whole snakemake execution crashes if a log file is binary and
show-failed-logs
is used.This fix prevents the crash by capturing the
UnicodeDecodeError
and returning an error message that the log file is not a text instead.QC
docs/
) is updated to reflect the changes or this is not necessary (e.g. if the change does neither modify the language nor the behavior or functionalities of Snakemake).