mirror of
https://github.com/enso-org/enso.git
synced 2024-11-22 22:10:15 +03:00
Fix query parameters in bench_download.py
tool (#7772)
URL query parameter construction in the `bench_donwload.py` tool uses `urllib` to properly quote, e.g., complex branch names. # Important Notes Fixes queries with complicated branch names, like `./bench_download.py -v -s stdlib --use-cache true -b develop wip/akirathan/6959-Integer.+-cannot-be-invoked-statically`
This commit is contained in:
parent
e0ee8fdda7
commit
294ee46af4
@ -65,6 +65,7 @@ from os import path
|
||||
from typing import List, Dict, Optional, Any, Union, Set
|
||||
from dataclasses import dataclass
|
||||
import xml.etree.ElementTree as ET
|
||||
from urllib.parse import urlencode
|
||||
|
||||
|
||||
if not (sys.version_info.major >= 3 and sys.version_info.minor >= 7):
|
||||
@ -300,12 +301,11 @@ def _read_json(json_file: str) -> Dict[Any, Any]:
|
||||
async def _invoke_gh_api(endpoint: str,
|
||||
query_params: Dict[str, str] = {},
|
||||
result_as_text: bool = True) -> Union[Dict[str, Any], bytes]:
|
||||
query_str_list = [key + "=" + value for key, value in query_params.items()]
|
||||
query_str = "&".join(query_str_list)
|
||||
urlencode(query_params)
|
||||
cmd = [
|
||||
"gh",
|
||||
"api",
|
||||
f"/repos/enso-org/enso{endpoint}" + ("" if len(query_str) == 0 else "?" + query_str)
|
||||
f"/repos/enso-org/enso{endpoint}" + "?" + urlencode(query_params)
|
||||
]
|
||||
logging.info(f"Starting subprocess `{' '.join(cmd)}`")
|
||||
proc = await asyncio.create_subprocess_exec("gh", *cmd[1:],
|
||||
|
Loading…
Reference in New Issue
Block a user