Webchecker Usage - a problem with local usage

Discussion in 'Python' started by Colin J. Williams, Feb 25, 2004.

  1. 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.
    Colin J. Williams, Feb 25, 2004
    #1
    1. Advertising

  2. 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.
    Colin J. Williams, Feb 26, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. karim
    Replies:
    1
    Views:
    758
    George Ter-Saakov
    Jun 26, 2003
  2. =?Utf-8?B?WVNVVA==?=

    Access local port or Running local exe file

    =?Utf-8?B?WVNVVA==?=, Jan 14, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    499
    =?Utf-8?B?WVNVVA==?=
    Jan 14, 2006
  3. Jim in Arizona
    Replies:
    8
    Views:
    4,958
    Jim in Arizona
    Jan 24, 2006
  4. lurker
    Replies:
    1
    Views:
    691
    Disco Octopus
    Apr 5, 2005
  5. Kevin Walzer

    Licence for webchecker module?

    Kevin Walzer, May 13, 2007, in forum: Python
    Replies:
    0
    Views:
    233
    Kevin Walzer
    May 13, 2007
Loading...

Share This Page