We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parent8ce3e30 commite236fd9Copy full SHA for e236fd9
gitlab.py
@@ -445,6 +445,8 @@ def Team(self, id=None, **kwargs):
445
"""
446
returnself._getListOrObject(Team,id,**kwargs)
447
448
+def_get_display_encoding():
449
+returnsys.stdout.encodingorsys.getdefaultencoding()
450
451
classGitlabObject(object):
452
_url=None
@@ -574,7 +576,7 @@ def _obj_to_str(obj):
574
576
s=", ".join([GitlabObject._obj_to_str(x)forxinobj])
575
577
return"[ %s ]"%s
578
elifisinstance(obj,unicode):
-returnobj.encode(sys.stdout.encoding,"replace")
579
+returnobj.encode(_get_display_encoding(),"replace")
580
else:
581
returnstr(obj)
582
@@ -585,8 +587,8 @@ def pretty_print(self, depth=0):
585
587
ifk==self.idAttr:
586
588
continue
589
v=self.__dict__[k]
-pretty_k=k.replace('_','-').encode(sys.stdout.encoding,
-"replace")
590
+pretty_k=k.replace('_','-')
591
+pretty_k=pretty_k.encode(_get_display_encoding(),"replace")
592
ifisinstance(v,GitlabObject):
593
ifdepth==0:
594
print("%s:"%pretty_k)