Bug 215266 - yumdownloader gives an ugly error message when it cannot write to the working directory
yumdownloader gives an ugly error message when it cannot write to the working...
Product: Fedora
Classification: Fedora
Component: yum-utils (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Seth Vidal
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2006-11-12 22:58 EST by Tim Mayberry
Modified: 2007-11-30 17:11 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-02-14 04:32:58 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Tim Mayberry 2006-11-12 22:58:51 EST
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):


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 ?
  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
  File "/usr/lib/python2.4/site-packages/yum/yumRepo.py", line 451, in __get
  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
    return func_ref( *(fullurl,), **kwargs )
  File "/usr/lib/python2.4/site-packages/urlgrabber/grabber.py", line 927, in
    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
  File "/usr/lib/python2.4/site-packages/urlgrabber/grabber.py", line 1196, in
    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.
Comment 1 Tim Lauridsen 2007-02-14 04:32:58 EST
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.

Note You need to log in before you can comment on or make changes to this bug.