diff options
author | 2017-04-05 14:16:49 -0700 | |
---|---|---|
committer | 2017-04-05 14:16:49 -0700 | |
commit | bee0dec6c4c65787ce340d0610591d879f13da1a (patch) | |
tree | 624e2b3dd5a9842d10037cdb770bb4fa84c31d53 | |
parent | 86559441a1026f283583d611196c3f66deaa0297 (diff) |
Encode special characters in email addresses.
Now accept email addresses with '+' character.
Bug: 33166666
Test: checkowners.py -v -c `find . -name OWNERS`
Change-Id: I7792551e6be74e942906a75344233439d4bfeca3
-rwxr-xr-x | tools/checkowners.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/checkowners.py b/tools/checkowners.py index 8f450e7a43..b8749550da 100755 --- a/tools/checkowners.py +++ b/tools/checkowners.py @@ -5,6 +5,7 @@ import argparse import re import sys +import urllib import urllib2 parser = argparse.ArgumentParser(description='Check OWNERS file syntax') @@ -29,7 +30,8 @@ def echo(msg): def find_address(address): if address not in checked_addresses: - request = gerrit_server + '/accounts/?suggest&q=' + address + request = (gerrit_server + '/accounts/?n=1&o=ALL_EMAILS&q=email:' + + urllib.quote(address)) echo('Checking email address: ' + address) result = urllib2.urlopen(request).read() expected = '"email": "' + address + '"' |