Description of problem: yumdownloader gives an ugly error message(Traceback) when it doesn't have write permission on the current working directory. Version-Release number of selected component (if applicable): yum-utils-1.0.1-1.fc6 How reproducible: Try and download a package with a non-writable working directory Actual results: Traceback (most recent call last): File "/usr/bin/yumdownloader", line 191, in ? main() File "/usr/bin/yumdownloader", line 181, in main path = repo.getPackage(download) File "/usr/lib/python2.4/site-packages/yum/yumRepo.py", line 468, in getPackage cache=cache File "/usr/lib/python2.4/site-packages/yum/yumRepo.py", line 451, in __get http_headers=headers, File "/usr/lib/python2.4/site-packages/urlgrabber/mirror.py", line 411, in urlgrab return self._mirror_try(func, url, kw) File "/usr/lib/python2.4/site-packages/urlgrabber/mirror.py", line 397, in _mirror_try return func_ref( *(fullurl,), **kwargs ) File "/usr/lib/python2.4/site-packages/urlgrabber/grabber.py", line 927, in urlgrab return self._retry(opts, retryfunc, url, filename) File "/usr/lib/python2.4/site-packages/urlgrabber/grabber.py", line 845, in _retry r = apply(func, (opts,) + args, {}) File "/usr/lib/python2.4/site-packages/urlgrabber/grabber.py", line 915, in retryfunc fo._do_grab() File "/usr/lib/python2.4/site-packages/urlgrabber/grabber.py", line 1196, in _do_grab else: new_fo = open(self.filename, 'wb') IOError: [Errno 13] Permission denied: './xsane-0.991-2.fc6.src.rpm' Expected results: "Unable to write to current working directory" or whatever Additional info: It would be nice if testing that the current directory was writable was done as a first step as it takes roughly 6 seconds to produce the above error on my system.
yumdownloader is a simple tool, it fails if it can't write to the current directory or runs out of diskspace or something else. I think it is out of scope for a tool like yumdownloader to catch all these speciel conditions and give more human readable error messages. Feel free to create a patch and i will add it.