Skip to content

Commit

Permalink
client: use tempdir for apispec
Browse files Browse the repository at this point in the history
  • Loading branch information
tschaume committed Jan 13, 2022
1 parent 7084984 commit 6350649
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mpcontribs-client/mpcontribs/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
from pint.unit import UnitDefinition
from pint.converters import ScaleConverter
from pint.errors import DimensionalityError
from tempfile import gettempdir

RETRIES = 3
MAX_WORKERS = 8
Expand Down Expand Up @@ -379,7 +380,8 @@ def _load(protocol, host, headers_json, project):
http_client = FidoClientGlobalHeaders(headers=headers)
url = f"{protocol}://{host}"
origin_url = f"{url}/apispec.json"
apispec = Path(urlsafe_b64encode(origin_url.encode('utf-8')).decode('utf-8'))
fn = urlsafe_b64encode(origin_url.encode('utf-8')).decode('utf-8')
apispec = Path(gettempdir()) / fn

if apispec.exists():
spec_dict = ujson.loads(apispec.read_bytes())
Expand Down

0 comments on commit 6350649

Please sign in to comment.