This is a follow-up question to the question on pushing to remote repo without local working directory(Python push files to Github remote repo without local working directory). I wonder what if the file already exists on the remote repo and I just want to update it with a modified file of the same name? (e.g., equivalent to on the Github website, upload a modified version of a file already existing on the remote)
Edit: We've come up with a solution:
contents_object = repository.contents(file_path)
push_status = contents_object.update("test_message",contents)
However, while this runs successfully on one machine, it threw an error on another machine (specifically, the first line will get an AttributeError). Is this because of potentially different versions of github3?