summaryrefslogtreecommitdiffstats
path: root/Lib/urllib/request.py
diff options
context:
space:
mode:
authorSenthil Kumaran <senthil@uthcode.com>2012-05-15 16:03:29 (GMT)
committerSenthil Kumaran <senthil@uthcode.com>2012-05-15 16:03:29 (GMT)
commit92a5bf0c0aae607da90bb08a01b7d06c4c8b45fe (patch)
tree17d1d7f72d6cb29dd1bb668f9f4ec6295258b648 /Lib/urllib/request.py
parentacfc26acb0dff670f68a59c82762e21e81cc7fb0 (diff)
parent0ea91cb5c6eac161722b3109ac636d5c782bf454 (diff)
downloadcpython-92a5bf0c0aae607da90bb08a01b7d06c4c8b45fe.zip
cpython-92a5bf0c0aae607da90bb08a01b7d06c4c8b45fe.tar.gz
cpython-92a5bf0c0aae607da90bb08a01b7d06c4c8b45fe.tar.bz2
Issue12541 - Add UserWarning for unquoted realms
Diffstat (limited to 'Lib/urllib/request.py')
-rw-r--r--Lib/urllib/request.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py
index 6cc78ed..96bb8d7 100644
--- a/Lib/urllib/request.py
+++ b/Lib/urllib/request.py
@@ -934,6 +934,9 @@ class AbstractBasicAuthHandler:
mo = AbstractBasicAuthHandler.rx.search(authreq)
if mo:
scheme, quote, realm = mo.groups()
+ if quote not in ['"',"'"]:
+ warnings.warn("Basic Auth Realm was unquoted",
+ UserWarning, 2)
if scheme.lower() == 'basic':
response = self.retry_http_basic_auth(host, req, realm)
if response and response.code != 401: