diff options
author | Guido van Rossum <guido@python.org> | 2001-12-11 22:41:24 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2001-12-11 22:41:24 (GMT) |
commit | f0953b9dff9a0cc08b6dcfe206047c0490e1d38a (patch) | |
tree | 830470b9151fb3e794cb285becc5c004210f3d64 | |
parent | 3a8e59ebe158d1fed37e9e916e1fa7b8af24a5d8 (diff) | |
download | cpython-f0953b9dff9a0cc08b6dcfe206047c0490e1d38a.zip cpython-f0953b9dff9a0cc08b6dcfe206047c0490e1d38a.tar.gz cpython-f0953b9dff9a0cc08b6dcfe206047c0490e1d38a.tar.bz2 |
Fix SF bug #482171: webchecker dies on file: URLs w/o robots.txt
The cause seems to be that when a file URL doesn't exist,
urllib.urlopen() raises OSError instead of IOError. Simply add this
to the except clause. Not elegant, but effective. :-)
-rwxr-xr-x | Tools/webchecker/webchecker.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Tools/webchecker/webchecker.py b/Tools/webchecker/webchecker.py index 091d0d2..071c2f6 100755 --- a/Tools/webchecker/webchecker.py +++ b/Tools/webchecker/webchecker.py @@ -335,7 +335,7 @@ class Checker: rp.set_url(url) try: rp.read() - except IOError, msg: + except (OSError, IOError), msg: self.note(1, "I/O error parsing %s: %s", url, msg) def run(self): @@ -533,7 +533,7 @@ class Checker: url, fragment = url_pair try: return self.urlopener.open(url) - except IOError, msg: + except (OSError, IOError), msg: msg = self.sanitize(msg) self.note(0, "Error %s", msg) if self.verbose > 0: |