Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions b2sdk/_internal/transfer/inbound/downloaded_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,12 @@ def save_to(
try:
with context as file:
return self.save(file, allow_seeking=allow_seeking)
except BrokenPipeError as ex:
if is_stdout:
# Output was likely piped through a command such as head. Just ignore the error
return
else:
raise ex
finally:
if not is_stdout:
set_file_mtime(path_, self.download_version.mod_time_millis)
Expand Down
1 change: 1 addition & 0 deletions changelog.d/534.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Suppress BrokenPipeError when saving downloaded content to stdout.