Skip to content

UnicodeEncodeError in verbose mode #6

Closed

Description

@mohierf

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)

Activity

  1. mohierf commented on Sep 2, 2013

    @mohierf
    Author

    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")
    
  2. locked as resolved and limited conversation to collaborators on Dec 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions