From d57815a882242ec16b2b4aab7ea25425f3be65f3 Mon Sep 17 00:00:00 2001 From: Kentaro Wada Date: Sat, 20 Jan 2024 11:45:19 +0900 Subject: [PATCH] Print log message to stderr instead of stdout --- gdown/cached_download.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gdown/cached_download.py b/gdown/cached_download.py index bec712d6..10c4fc92 100644 --- a/gdown/cached_download.py +++ b/gdown/cached_download.py @@ -33,12 +33,12 @@ def assert_md5sum(filename, md5, quiet=False, blocksize=None): raise ValueError("MD5 must be 32 chars: {}".format(md5)) if not quiet: - print("Computing MD5: {}".format(filename)) + print("Computing MD5: {}".format(filename), file=sys.stderr) md5_actual = md5sum(filename) if md5_actual == md5: if not quiet: - print("MD5 matches: {}".format(filename)) + print("MD5 matches: {}".format(filename), file=sys.stderr) return True raise AssertionError( @@ -83,7 +83,7 @@ def cached_download( # check existence if osp.exists(path) and not md5: if not quiet: - print("File exists: {}".format(path)) + print("File exists: {}".format(path), file=sys.stderr) return path elif osp.exists(path) and md5: try: