wasm-demo/demo/ermis-f/python_m/cur/0486

49 lines
1.6 KiB
Plaintext

From: guido at eric.cnri.reston.va.us (Guido van Rossum)
Date: 26 Apr 1999 19:08:18 -0400
Subject: webchecker on Windows
References: <Eh22+AAtjbI3Ew3o@desb.demon.co.uk>
Message-ID: <5logkbrndp.fsf@eric.cnri.reston.va.us>
Content-Length: 1328
X-UID: 486
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/)