Kaydet (Commit) 89efda36 authored tarafından Guido van Rossum's avatar Guido van Rossum

Avoid the fancy handler for error 401 (request authentication).

üst 78089e20
...@@ -93,10 +93,8 @@ rooturl -- URL to start checking ...@@ -93,10 +93,8 @@ rooturl -- URL to start checking
""" """
# ' Emacs bait
__version__ = "0.5"
__version__ = "0.4"
import sys import sys
...@@ -487,7 +485,12 @@ class MyURLopener(urllib.FancyURLopener): ...@@ -487,7 +485,12 @@ class MyURLopener(urllib.FancyURLopener):
def __init__(*args): def __init__(*args):
self = args[0] self = args[0]
apply(urllib.FancyURLopener.__init__, args) apply(urllib.FancyURLopener.__init__, args)
self.addheaders = [('User-agent', 'Python-webchecker/%s' % __version__)] self.addheaders = [
('User-agent', 'Python-webchecker/%s' % __version__),
]
def http_error_401(self, url, fp, errcode, errmsg, headers):
return None
def open_file(self, url): def open_file(self, url):
path = urllib.url2pathname(urllib.unquote(url)) path = urllib.url2pathname(urllib.unquote(url))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment