webchecker on Windows

Guido van Rossum guido at eric.cnri.reston.va.us
Mon Apr 26 19:08:18 EDT 1999


Des Barry <desb at desb.demon.co.uk> writes:

> I have just recently downloaded 1.5.2(final) and tried to use webchecker
> on a local file tree.
> 
> I am unable to get it to work - as it did in 1.5.2b2 (with a patch
> applied to urllib)
> 
> The arguments to webchecker that I use are:
> 
> -x file:///D|/test1/test2/index.htm
> 
> this does not find the file!
> 
> -x file:/D|/test1/test2/index.htm
> 
> this is able to read the file but not able to process any links
> contained in the file (all local links are internally created like
> file:xxx.htm)

Unfortunately, you're right.  I think that the change has to do with
the changes in urllib.py regarding when to use url2pathname() and
pathname2url() -- the new policy is much more useful, but webchecker
was counting on the old policy.  (The policy change is that the url
argument to open(), open_file(), open_local_file() and the like must
always be in url format.)

Below is a patch that I think makes it work, but it still requires
that you use forward slashes in the file: URL you give it.  It
supports drive letters but only if you use the form "file:/D|/path";
the form "file:///D|/path" doesn't seem to work due to the way
urlparse works.

I hope someone else can continue the analysis from here...

--Guido van Rossum (home page: http://www.python.org/~guido/)




More information about the Python-list mailing list