Skip to content

Commit

Permalink
Prevents printing attempt for binary logs
Browse files Browse the repository at this point in the history
Previously a binary log file would cause `show_logs` to crash the whole
snakemake workflow execution with a `UnicodeDecodeError`.

Closes #2826
  • Loading branch information
Vito Zanotelli committed Apr 19, 2024
1 parent 77620f8 commit 4b7a9cc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions snakemake/logging.py
Expand Up @@ -506,6 +506,9 @@ def show_logs(logs):
except FileNotFoundError:
yield f"Logfile {f} not found."
return
except UnicodeDecodeError:
yield f"Logfile {f} is not a text file."
return
lines = content.splitlines()
logfile_header = f"Logfile {f}:"
if not lines:
Expand Down

0 comments on commit 4b7a9cc

Please sign in to comment.