diff --git a/sh.py b/sh.py index fb0f5fe7..06c34357 100644 --- a/sh.py +++ b/sh.py @@ -1854,6 +1854,9 @@ def finish(): if hasattr(handler, "flush"): handler.flush() + if hasattr(handler, "close"): + handler.close() + return process, finish def get_callback_chunk_consumer(handler, encoding, decode_errors):