1
0
mirror of https://github.com/golang/go synced 2024-11-22 00:24:41 -07:00

codereview: handle spaces and other unexpected chars in nicknames

R=r
https://golang.org/cl/157053
This commit is contained in:
Russ Cox 2009-11-17 16:52:36 -08:00
parent d05fa26a7d
commit aae0aefb70

View File

@ -1351,7 +1351,9 @@ def DownloadCL(ui, repo, clname):
# The author is just a nickname: get the real email address.
try:
data = MySend("/user_popup/" + nick, force_auth=False)
# want URL-encoded nick, but without a=, and rietveld rejects + for %20.
url = "/user_popup/" + urllib.urlencode({"a": nick})[2:].replace("+", "%20")
data = MySend(url, force_auth=False)
except:
ui.warn("error looking up %s: %s\n" % (nick, ExceptionDetail()))
cl.original_author = nick+"@needtofix"