Is there a consensus to not allow arbitrary unicode in command line output? 
It seems like it might be useful, but apparently its technically not 
supported. Is this a bug or a feature?

For the record, if your _repr_() method returns actual unicode then the 
following happens:
 
---------------------------------------------------------------------------
UnicodeEncodeError                        Traceback (most recent call last)

/home/vbraun/opt/sage-4.7.rc2/devel/sage-main/<ipython console> in 
<module>()

/home/vbraun/Sage/sage/local/lib/python2.6/site-packages/IPython/Prompts.pyc 
in __call__(self, arg)
    549 
    550             # and now call a possibly user-defined print mechanism
--> 551             manipulated_val = self.display(arg)
    552             
    553             # user display hooks can change the variable to be 
stored in

/home/vbraun/Sage/sage/local/lib/python2.6/site-packages/IPython/Prompts.pyc 
in _display(self, arg)
    575             return IPython.generics.result_display(arg)
    576         except TryNext:            
--> 577             return self.shell.hooks.result_display(arg)
    578 
    579     # Assign the default display method:

/home/vbraun/Sage/sage/local/lib/python2.6/site-packages/IPython/hooks.pyc 
in __call__(self, *args, **kw)
    139             #print "prio",prio,"cmd",cmd #dbg
    140             try:
--> 141                 ret = cmd(*args, **kw)
    142                 return ret
    143             except ipapi.TryNext, exc:

/home/vbraun/Sage/sage/local/lib/python2.6/site-packages/sage/misc/displayhook.pyc
 
in result_display(ip_self, obj)
    148     # IPython's default result_display() uses the 
IPython.genutils.Term.cout stream.
    149     # See also local/lib/python2.6/site-packages/IPython/hooks.py.
--> 150     print_obj(IPython.genutils.Term.cout, obj)
    151 
    152 def displayhook(obj):

/home/vbraun/Sage/sage/local/lib/python2.6/site-packages/sage/misc/displayhook.pyc
 
in print_obj(out_stream, obj)
    140             if _check_tall_list_and_print(out_stream, obj):
    141                 return
--> 142     print >>out_stream, `obj`
    143 
    144 def result_display(ip_self, obj):

UnicodeEncodeError: 'ascii' codec can't encode character u'\u2283' in 
position 5: ordinal not in range(128)


-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to