Replies: 1 comment
-
Ok, now I replaced the PyGithub call with a requests post request, but nothing changed for the behaviour. So it is probably not PyGithub's fault: release_id = release.id
#release.upload_asset(file)
# Send a request because the upload_asset method is not working
url = f"https://uploads.github.com/repos/Vuizur/tatoeba-to-anki/releases/{release_id}/assets?name={file}"
headers = {
"Accept": "application/vnd.github.v3+json",
# apkg files are zip files
"Content-Type": "application/zip",
# the authorization token
"Authorization": f"token {os.getenv('GITHUB_TOKEN')}",
}
with open(file, "rb") as f:
response = requests.post(url, headers=headers, data=f)
print(response) Edit: I also rewrote it in octokit, but the behaviour stayed the same: octokit/octokit.js#2402. So it's not a Python issue probably. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello everyone,
I am trying to create a release and upload all files with a specific ending as an asset. My code is as follows:
Unfortunately, this doesn't quite work. When I run the code, it prints:
It successfully uploads the first asset, which is perfectly visible on Github. However, after that nothing happens, and no network traffic is visible on the task manager. It is as if the
upload_asset
function never returns despite having finished.Thanks for the help!
System: Windows 11
Python: 3.10.9
Beta Was this translation helpful? Give feedback.
All reactions