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

Updating different files in the same repo at the same time return 409 conflict error #59

Open
deepakdialpad opened this issue Aug 11, 2023 · 1 comment

Comments

@deepakdialpad
Copy link

I am trying to use the githubpy library in my setup. My requirement is to update multiple different files in the repo. The request to update the files in git happens almost at the same time.
Sample code is like below. This is called with different file names from different places.

github_client = github.GitHub(access_token=access_token)
file_content = base64.b64encode(some_data).decode()
response = (github_client.repos(owner)(repo)('contents')(file_name)
                .put({'message': message,
                      'content': file_content,
                      'sha': file_sha,
                      'branch': branch}))

The first file update is successful but the subsequent file updated fail.
With this we always get the error. Error 409: Conflict

May i know is there a limitation on the githubpy library in doing this operation ?

@michaelliao
Copy link
Owner

Hi,
githubpy is only a wrapper for the REST APIs. You can use GitHub(access_token='xxx', debug=True) to log and execute the curl command manually. If curl failed then there is something wrong with the args.

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