Webchecker Usage - a problem with local usage

Colin J. Williams cjw at sympatico.ca
Wed Feb 25 19:28:01 EST 2004


Colin J. Williams wrote:
> I have material on a local PC which I upload to a web server.
> 
> I would like to use webchecker to check both the local linkage and that 
> at the remote server.
> 
> All works well when I check the remote server:  http://www3.sympatico. 
> ....  The URL for the index.html.
> 
> However, only the index.html is read when using: file:C:\\Python23/ 
> ....           The URL for the index.html.
> 
> The problem arises in the Checker method, where the basic structure of 
> the url has been changed.  It no longer contains the root:
> 
>        def inroots(self, url):
>            for root in self.roots:
>                if url[:len(root)] == root:
>                    return self.isallowed(root, url)
>            return 0
> 
> It appears to be caused at urlparse lines 129 and 130,  where three '/' 
> characters are prepended to the URL.
> 
> By commenting out lines 128, 128 and 130 of urlparse, I get the same 
> report for the local files that I get from the web server.
> 
> I don't like modifying a library routine, even a local copy and would 
> appreciate advice.
> 
> Thanks.
> 
> Colin W.
> 
Unfortunately, the change to urlparse has an unintended side-effect.

It prevents the check of any external links from the local machine.

Colin W.




More information about the Python-list mailing list