Closed choldgraf closed 3 years ago
Do you mind sharing the full code of what you were trying to do with an example of what failed? This would help greatly! I can then use this directly in the docs!
Sure - for example, let's say I wanted to update this label:
https://github.com/jupyterhub/nativeauthenticator/labels/help%20wanted
to help-wanted
(instead of help wanted
)
if I ran:
api.issues.update_label("jupyterhub", "nativeauthenticator", "help wanted", "help-wanted")
I get
HTTP400BadRequestError: HTTP Error 400: Bad Request
if instead I run
api.issues.update_label("jupyterhub", "nativeauthenticator", quote("help wanted"), "help-wanted")
then it works
This doesn't always happen for things that have spaces in them (e.g., I am able to set labels on issues with spaces in them without escaping them), but for some reason the error pops up sometimes
Thanks for the report @choldgraf . I've just pushed a update so you now don't need to URL-quote some parameters.
I just found a gotcha where I was trying to update a github label that had a space in it. Trying to do so was raising a 400 error. I fixed it by doing:
It would be helpful to either automate this under-the-hood, or to raise a more helpful error that suggests this might be the issue.