diff options
author | Josh Hoyt <josh@janrain.com> | 2005-12-23 22:20:48 +0000 |
---|---|---|
committer | Josh Hoyt <josh@janrain.com> | 2005-12-23 22:20:48 +0000 |
commit | e162d5b26db43d86fb610f3c949464fbdce89211 (patch) | |
tree | 2a14d330a08b4de3c35ec818b5206e082912acb4 /openid/oidutil.py | |
parent | e6f11216d3f04e9eed6e2722ee3802443b677818 (diff) | |
download | openid-e162d5b26db43d86fb610f3c949464fbdce89211.tar.gz |
[project @ Make URL normalization deal better with Unicode domain names when the idna codec is not present (2.2 compatibility)]
Diffstat (limited to 'openid/oidutil.py')
-rw-r--r-- | openid/oidutil.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/openid/oidutil.py b/openid/oidutil.py index a31c6ac..89e8847 100644 --- a/openid/oidutil.py +++ b/openid/oidutil.py @@ -73,7 +73,10 @@ def normalizeUrl(url): parsed = urlparse.urlparse(url) if isinstance(url, unicode): - authority = parsed[1].encode('idna') + try: + authority = parsed[1].encode('idna') + except LookupError: + authority = parsed[1].encode('us-ascii') else: authority = str(parsed[1]) |