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

Verbose cloning causes UnicodeDecodeError in debugf(). #167

Conversation

leandro-lucarella-sociomantic
Copy link
Contributor

$ git hub -v clone sociomantic/git-hub
...
https://api.github.com/user/repos?page=3
Content-length: 0
Content-type: application/json
Authorization: <hidden>
Accept: application/vnd.github.v3+json
None
Traceback (most recent call last):
  File "/usr/bin/git-hub", line 2017, in <module>
    main()
  File "/usr/bin/git-hub", line 2011, in main
    args.run(parser, args)
  File "/usr/bin/git-hub", line 615, in check_config_and_run
    cmd.run(parser, args)
  File "/usr/bin/git-hub", line 769, in run
    '{}/{}'.format(owner, proj))
  File "/usr/bin/git-hub", line 813, in set_not_own_repo_params
    for repo in req.get('/user/repos'):
  File "/usr/bin/git-hub", line 479, in <lambda>
    self.json_req(url, method, *args, **kwargs)
  File "/usr/bin/git-hub", line 457, in json_req
    debugf("Response:\n{}", data)
  File "/usr/bin/git-hub", line 74, in debugf
    localeprintf(sys.stdout, fmt, *args, **kwargs)
  File "/usr/bin/git-hub", line 65, in localeprintf
    msg = fmt.decode(encoding, 'replace').format(*args, **kwargs) + '\n'
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 124672: ordinal not in range(128)

@leandro-lucarella-sociomantic
Copy link
Contributor

I can't reproduce this with the latest master, could you recheck?

@jwilk
Copy link
Contributor Author

jwilk commented Dec 17, 2015

Yup, it's still reproducible.
I think it barfs only if you have a repo with non-ASCII description in your /user/repos.
Forking kennethreitz/requests beforehand should help with reproducing. :)

@leandro-lucarella-sociomantic
Copy link
Contributor

Reproduced. Thanks!

@leandro-lucarella-sociomantic
Copy link
Contributor

I'm bumping #46 to hopefully getting it fixed for v0.11. I can't take this walking on a mine field anymore :)

@leandro-lucarella-sociomantic
Copy link
Contributor

Fix attached and fingers crossed so everything doesn't 💥

@jwilk
Copy link
Contributor Author

jwilk commented Dec 17, 2015

0625f4d looks good to me!

@leandro-lucarella-sociomantic
Copy link
Contributor

@mihails-strasuns-sociomantic is sick so I will just auto-merge.

@leandro-lucarella-sociomantic
Copy link
Contributor

This pull request has been rebased via git hub pull rebase. Original pull request HEAD was 0625f4d, new (rebased) HEAD is 13931c1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants