Skip to content

UnicodeEncodeError in verbose mode #6

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

Closed
mohierf opened this issue Sep 2, 2013 · 1 comment
Closed

UnicodeEncodeError in verbose mode #6

mohierf opened this issue Sep 2, 2013 · 1 comment
Assignees
Labels

Comments

@mohierf
Copy link

mohierf commented Sep 2, 2013

Hi,
when using the verbose mode, I always get an UnicodeEncoreError. My OS is Windows 7 French edition ...
Best regards, Fred

python python-gitlab.py project-issue get --project-id=1 --id=118 -v


id: 118
assignee: None
author:
  id: 6
  created-at: 2013-07-22T04:51:44Z
  email: ******
  name: ******
  state: active
  username: mohierf
created-at: 2013-08-27T12:51:52Z
Traceback (most recent call last):
  File "python-gitlab.py", line 319, in <module> o.display(verbose)
  File "C:\gitIPM\Win7Kiosks-Operating\maintenance\content\gitlab\gitlab.py", line 503, in display
    self.pretty_print()
  File "C:\gitIPM\Win7Kiosks-Operating\maintenance\content\gitlab\gitlab.py", line 543, in pretty_print
    v = GitlabObject._obj_to_str(v)
  File "C:\gitIPM\Win7Kiosks-Operating\maintenance\content\gitlab\gitlab.py", line 524, in _obj_to_str
    return str(obj)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 45: ordinal not in range(128)
@mohierf
Copy link
Author

mohierf commented Sep 2, 2013

A priori, avec les modifications ci-dessous, ça fonctionnerait :

line 21 : import sys
line 525 : return str(obj.encode(sys.stdout.encoding, "replace") if obj else None)
line 534 : pretty_k = k.replace('_', '-').encode(sys.stdout.encoding, "replace")

@ghost ghost assigned gpocentek Sep 10, 2013
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants