summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Prahl <matthew.prahl@outlook.com>2017-11-13 15:19:28 -0500
committerNeal Gompa <ngompa13@gmail.com>2019-02-25 08:46:40 -0500
commit01fa32b0f1fa06b6681d15eb7c545629dcbefb5e (patch)
treeb0cbfbe09e2c675cd996d6fdc35cfead5d3b8ee0
parentaabe9b0540390401fd8eacfa1d53378e6da6d9b5 (diff)
downloadurlgrabber-01fa32b0f1fa06b6681d15eb7c545629dcbefb5e.tar.gz
Raise an obvious error message when "urlgrabber-ext-down" is not installed
-rw-r--r--urlgrabber/grabber.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/urlgrabber/grabber.py b/urlgrabber/grabber.py
index 81a7855..a450671 100644
--- a/urlgrabber/grabber.py
+++ b/urlgrabber/grabber.py
@@ -2137,6 +2137,11 @@ import subprocess
class _ExternalDownloader:
def __init__(self):
+ # raise if urlgrabber-ext-down is not installed so the user gets a
+ # an obvious error message instead of "[Errno 5] [Errno 2] No such file
+ # or directory"
+ if not os.path.exists('/usr/libexec/urlgrabber-ext-down') and os.getenv('URLGRABBER_EXT_DOWN') is None:
+ raise OSError('"/usr/libexec/urlgrabber-ext-down" is not installed')
urlgrabber_path = (os.getenv('URLGRABBER_EXT_DOWN', None)
or '/usr/libexec/urlgrabber-ext-down')
self.popen = subprocess.Popen(