I am trying to edit an already created gist using the pygithub library but I have been unable to do so thus far.
import github.InputFileContent
from github import Github
g = Github("priv key")
gist = g.get_gist("004e205c856d5f934704333f5725d61e")
gist.edit(
"Description edited by PyGithub",
{"gistfile1.txt": github.InputFileContent("File also created by PyGithub")},
)
This results in these errors
Traceback (most recent call last):
File "/Users/boazburnett/Library/Application Support/JetBrains/PyCharmCE2022.2/scratches/scratch.py", line 9, in <module>
{"gistfile1.txt": github.InputFileContent("File also created by PyGithub")},
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/github/Gist.py", line 259, in edit
"PATCH", self.url, input=post_parameters
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/github/Requester.py", line 355, in requestJsonAndCheck
verb, url, parameters, headers, input, self.__customConnection(url)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/github/Requester.py", line 378, in __check
raise self.__createException(status, responseHeaders, output)
github.GithubException.UnknownObjectException: 404 {"message": "Not Found", "documentation_url": "https://docs.github.com/rest/reference/gists#update-a-gist"}