[Yum-devel] [UG] [PATCH] Don't fail when size is unknown

Zdenek Pavlas zpavlas at redhat.com
Fri Apr 5 11:05:31 UTC 2013


> I've hit the following problem numerous times, mainly when grabbing a
> local file.

>>> urlgrabber.urlgrab('file:///etc/passwd', 'bla')
>>> urlgrabber.urlgrab('file:///etc/passwd', 'bla', copy_local=True)

I can't reproduce that.  What version of urlgrabber are you using?

> +                    size = self.size
> +                    if size is not None:

The PyCurlFileObject.size attribute is initialized in __init__ to 0,
and updated to int(str) when the Content-Length header is parsed.
It can't be None, IMO.

More information about the Yum-devel mailing list