Updated this to work with python3 as per your suggestions. #1
Closed
agargiulo wants to merge 2 commits intoralphbean:masterfrom
Closed
Updated this to work with python3 as per your suggestions. #1agargiulo wants to merge 2 commits intoralphbean:masterfrom
agargiulo wants to merge 2 commits intoralphbean:masterfrom
Conversation
Author
|
I am using the python3 version for a script, and when I run it, I get this output: [~/GitHub-Backup] % python3 ./github-backup.py agargiulo backupsTraceback (most recent call last):
File "./github-backup.py", line 30, in <module>
main()
File "./github-backup.py", line 24, in main
user_repos = gh.repos.list(args.username).all()
File "/usr/lib/python3.2/site-packages/pygithub3-0.3-py3.2.egg/pygithub3/core/result/base.py", line 110, in all
return list(self.iterator())
File "/usr/lib/python3.2/site-packages/pygithub3-0.3-py3.2.egg/pygithub3/core/result/base.py", line 105, in iterator
for page in self:
File "/usr/lib/python3.2/site-packages/pygithub3-0.3-py3.2.egg/pygithub3/core/result/smart.py", line 91, in __next__
if self.page <= self.pages:
File "/usr/lib/python3.2/site-packages/pygithub3-0.3-py3.2.egg/pygithub3/core/result/smart.py", line 101, in pages
return self.getter.last
File "/usr/lib/python3.2/site-packages/pygithub3-0.3-py3.2.egg/pygithub3/core/result/smart.py", line 47, in last
self()
File "/usr/lib/python3.2/site-packages/pygithub3-0.3-py3.2.egg/pygithub3/core/result/smart.py", line 16, in wrapper
return func(self, page)
File "/usr/lib/python3.2/site-packages/pygithub3-0.3-py3.2.egg/pygithub3/core/result/smart.py", line 41, in __call__
self.cache[str(page)] = self.resource.loads(response.content)
File "/usr/lib/python3.2/site-packages/pygithub3-0.3-py3.2.egg/pygithub3/resources/base.py", line 33, in loads
resource_chunk = json.loads(json_content)
File "/usr/lib/python3.2/json/__init__.py", line 309, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.2/json/decoder.py", line 351, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
TypeError: can't use a string pattern on a bytes-like objectThe code is here: github-backup.py |
Owner
|
I ended up having to re-do this in eceebd5 I'm afraid I can't merge it due to strange merge conflicts upstream. Thanks, though! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Updated from python 2.x to python 3 using python-modernize