[Yum-devel] [UG] bug?

Ryan Tomayko rtomayko at gmail.com
Wed Mar 9 15:05:56 UTC 2005


On Mar 9, 2005, at 9:34 AM, yack wrote:
> g = URLGrabber()
> g._parse_url('http://example.com/index.html')
> returns 'http://example.com/%5Cindex.html'
>  
> Notice there´s an extra %5C.

Hmm. I get the following w/ current urlgrabber CVS and Python 2.4:

 >>> from urlgrabber.grabber import URLGrabber
 >>> g = URLGrabber()
 >>> g._parse_url('http://example.com/index.html')
('http://example.com/index.html',
  ('http', 'example.com', '/index.html', '', '', ''))

What version of urlgrabber and python are you running? That's surely a 
bug somewhere.

> In grabber.py, the line "path = os.path.normpath(path)" is missing 
> indentation ?

I think that line is okay. It should look like this:

   (scheme, host, path, parm, query, frag) = \
                                        urlparse.urlparse(url)
   if not scheme:
       if not url[0] == '/': url = os.path.abspath(url)
           url = 'file:' + url
           (scheme, host, path, parm, query, frag) = \
                                            urlparse.urlparse(url)
   path = os.path.normpath(path)

The "path = " line should be at the same level as "if not scheme".

Ryan




More information about the Yum-devel mailing list