[Pyobjc-dev] [ pyobjc-Bugs-2128265 ] obj-c instances should not return utf8 in __repr__
Brought to you by:
ronaldoussoren
From: SourceForge.net <no...@so...> - 2008-09-25 12:19:33
|
Bugs item #2128265, was opened at 2008-09-25 14:46 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=114534&aid=2128265&group_id=14534 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Vladimir Pouzanov (farcaller) Assigned to: Nobody/Anonymous (nobody) Summary: obj-c instances should not return utf8 in __repr__ Initial Comment: __repr__ of obj-c class instances should not return unicode (from [someobj description]), this makes interpreters (python, ipython) very unhappy, failing with: UnicodeEncodeError: 'ascii' codec can't encode character u'\u***' in position ***: ordinal not in range(128) repr should only return some internal description of object, return PyString_FromFormat( "<%s objective-c instance %p>", self->ob_type->tp_name, self->objc_object); this is really enough. __str__ could also return string, pre-encoded in utf-8 (.encode('utf8'), it's not supposed to return any utf8 chars too. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=114534&aid=2128265&group_id=14534 |