From 3f160eab8e6ed93fb14189c80d2a7d3901c88f73 Mon Sep 17 00:00:00 2001 From: Nick Sweeting Date: Thu, 12 Nov 2020 14:28:43 -0500 Subject: [PATCH] correctly handle WGET_AUTO_COMPRESSION failing when wget is missing --- archivebox/config.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/archivebox/config.py b/archivebox/config.py index d29cecd4..38ed5019 100644 --- a/archivebox/config.py +++ b/archivebox/config.py @@ -643,12 +643,15 @@ def find_chrome_data_dir() -> Optional[str]: return None def wget_supports_compression(config): - cmd = [ - config['WGET_BINARY'], - "--compression=auto", - "--help", - ] - return not run(cmd, stdout=DEVNULL, stderr=DEVNULL).returncode + try: + cmd = [ + config['WGET_BINARY'], + "--compression=auto", + "--help", + ] + return not run(cmd, stdout=DEVNULL, stderr=DEVNULL).returncode + except (FileNotFoundError, OSError): + return False def get_code_locations(config: ConfigDict) -> SimpleConfigValueDict: return {