]> Cypherpunks repositories - gostls13.git/commitdiff
codereview: handle spaces and other unexpected chars in nicknames
authorRuss Cox <rsc@golang.org>
Wed, 18 Nov 2009 00:52:36 +0000 (16:52 -0800)
committerRuss Cox <rsc@golang.org>
Wed, 18 Nov 2009 00:52:36 +0000 (16:52 -0800)
R=r
https://golang.org/cl/157053

lib/codereview/codereview.py

index 3376f0736401d286cf5f263318aedc626c9255b9..bed002b9f7f0e5f936f08809d60aa64ec78bf6d8 100644 (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"