Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query names containing the "/" character cause a NotFoundError #106

Closed
KADOTA-Masaki opened this issue Jun 14, 2022 · 1 comment
Closed

Comments

@KADOTA-Masaki
Copy link

I got an error with the following code.

with tdclient.Client(apikey) as client:
    history = client.history('foo/bar', 0, 10) # saved query name 'foo/bar', contains the '/' character.

NotFoundError: List history failed: {"error":"Path and method do not match any API endpoint","message":"Path and method do not match any API endpoint","text":"Path and method do not match any API endpoint","severity":"error","status_code":404}

And, I noticed that the '/' character in the name is not quoted.

quoted_values = {k: urlquote(str(v)) for k, v in values.items()}

expected: /v3/schedule/history/foo%2Fbar
but got: /v3/schedule/history/foo/bar

https://docs.python.org/3/library/urllib.parse.html#urllib.parse.quote

The optional safe parameter specifies additional ASCII characters that should not be quoted — its default value is '/'.

@chezou
Copy link
Member

chezou commented Aug 30, 2024

Fixed by #116

@chezou chezou closed this as completed Aug 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants