mirror of
https://github.com/python/cpython.git
synced 2025-08-22 01:35:16 +00:00
backport r57626
This commit is contained in:
parent
a9bad98e3d
commit
51cf11271f
2 changed files with 16 additions and 0 deletions
|
@ -233,6 +233,11 @@ class URLopener(urllib.FancyURLopener):
|
|||
urllib.FancyURLopener.__init__(self, *args)
|
||||
self.errcode = 200
|
||||
|
||||
def prompt_user_passwd(self, host, realm):
|
||||
## If robots.txt file is accessible only with a password,
|
||||
## we act as if the file wasn't there.
|
||||
return None, None
|
||||
|
||||
def http_error_default(self, url, fp, errcode, errmsg, headers):
|
||||
self.errcode = errcode
|
||||
return urllib.FancyURLopener.http_error_default(self, url, fp, errcode,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue