diff --git a/Lib/urllib.py b/Lib/urllib.py index 8ecef031cf0..35ba479fe22 100644 --- a/Lib/urllib.py +++ b/Lib/urllib.py @@ -393,7 +393,7 @@ def http_error_401(self, url, fp, errcode, errmsg, headers): match = re.match( '[ \t]*([^ \t]+)[ \t]+realm="([^"]*)"', stuff) if match: - scheme, realm = match.group() + scheme, realm = match.groups() if string.lower(scheme) == 'basic': return self.retry_http_basic_auth( url, realm) @@ -436,11 +436,15 @@ def prompt_user_passwd(self, host, realm): return None, None def echo_off(self): - os.system("stty -echo") + # XXX Is this sufficient??? + if hasattr(os, "system"): + os.system("stty -echo") def echo_on(self): - print - os.system("stty echo") + # XXX Is this sufficient??? + if hasattr(os, "system"): + print + os.system("stty echo") # Utility functions