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
Recently random 401 Bad Credentials exceptions #151
Comments
Hello! I've also experienced this issue in the past few days. It must be a bug on GIthub's side, it's not related to PyGithub. It can be reproduced with the following shell script (call it with your login and password as arguments):
It outputs a certain number of "OK"s and ends with the error message leading to the exception thrown by PyGithub:
You might want to submit a bug to Github directly. |
Yesterday I had no problems, today it's fully bugged again. I did a quick and dirty hack to work around the Github issue in PaginatedList.py def _fetchNextPage(self):
myWorkaround = True
while myWorkaround:
try:
headers, data = self.__requester.requestJsonAndCheck("GET", self.__nextUrl, self.__nextParams, None)
myWorkaround = False
except:
pass
[…] |
Today I also experienced the issue on a simple script doing only a few (non-paginated) requests to the API. It is absolutely not critical for me, so I will not take the time to contact GitHub myself. The issue is more general than pagination, so if you really need a workaround, you may prefer to do it in Requester.py: Replace line 143
by something like
(I have not tested at all) |
Thanks for providing that snippet 👍 Cheers. |
Hi,
PyGithub is a part of https://github.com/Borkason/google-code-issues-migrator, which is a fork by itself from an abandoned project, and recently I get random 401 Bad Credentials exceptions with that script. This exception did not show up in the past, that's why I think it might have to do with how PyGithub handles the Credentials. Maybe Github changed something in the past 1 or 2 months?
I could not find any pattern in the appearance of the exceptions, yet. I think it's random.
This is what I do
I authenticate once in
__main__
: https://github.com/Borkason/google-code-issues-migrator/blob/master/migrateissues.py#L493.Then I start migrating all the issues. The script fetches all issues, does some things with the google code api and then creates new issues in github, including comments. Mostly during the issue creation I recieve the exceptions. Always at a random point (sometimes after adding 2 issues, sometimes after adding 100 issues ...
I hope you can help in any way.
This is the exception
The text was updated successfully, but these errors were encountered: