osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-dev/+/36765?usp=email )
Change subject: src/grd: urlencode / in project names ......................................................................
src/grd: urlencode / in project names
Fix that it didn't work with projects that contain a slash character, such as erlang/osmo-epdg.
Change-Id: I810d6d0654ab8f3019c00e32762edfef7e7350a7 --- M src/grd 1 file changed, 15 insertions(+), 1 deletion(-)
Approvals: osmith: Looks good to me, approved; Verified
diff --git a/src/grd b/src/grd index 0ca5df7..e149c6f 100755 --- a/src/grd +++ b/src/grd @@ -9,6 +9,7 @@ import os import subprocess import urllib.request +import urllib.parse
def get_topdir(): @@ -37,7 +38,8 @@
def get_gerrit_details(host, project, patch_id, verbose): - url = f"https://%7Bhost%7D/changes/%7Bproject%7D~%7Bargs.patch_id%7D/detail" + project_q = urllib.parse.quote(project, "") + url = f"https://%7Bhost%7D/changes/%7Bproject_q%7D~%7Bargs.patch_id%7D/detail" print(f"Download {url}") with urllib.request.urlopen(url) as response: content = response.read().decode()