Letractively / sagenb

Automatically exported from code.google.com/p/sagenb
0 stars 0 forks source link

UnicodeEncodeError: 'ascii' codec can't encode character u'\xfc' in position 44: ordinal not in range(128) #79

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
On alpha.sagenb.org, with the new notebook:

2011-12-12 07:53:28-0800 [HTTPChannel,10000,127.0.0.1] <unicode instance at 
0x3b890f0 with str error:
         Traceback (most recent call last):
          File "/sagenb/sage_install/sage-4.7.2/local/lib/python2.6/site-packages/Twisted-11.0.0-py2.6-linux-x86_64.egg/twisted/python/reflect.py", line 546, in _safeFormat
            return formatter(o)
        UnicodeEncodeError: 'ascii' codec can't encode character u'\xfc' in position 44: ordinal not in range(128)
        >

Original issue reported on code.google.com by jason-go...@creativetrax.com on 13 Dec 2011 at 6:13

GoogleCodeExporter commented 8 years ago
I took care of some of these errors in 5b5f24d06e14

This error comes from trying to print to the log a message that has unicode in 
it.  I don't know where the printing is happening, though.  I'll keep my eyes 
on the error logs and see if any more messages like this happen.

Original comment by jason-go...@creativetrax.com on 13 Dec 2011 at 8:17

GoogleCodeExporter commented 8 years ago
I changed the _safeFormat function in 
/sagenb/sage_install/sage-4.7.2/local/lib/python2.6/site-packages/Twisted-11.0.0
-py2.6-linux-x86_64.egg/twisted/python/reflect.py to this to try to track down 
the problem:

def _safeFormat(formatter, o):
    """
    Helper function for L{safe_repr} and L{safe_str}.
    """
    try:
        return formatter(o)
    except:
        io = StringIO()
        traceback.print_exc(file=io)
        className = _determineClassName(o)
        tbValue = io.getvalue()
        if formatter != repr:
            o_repr=_safeFormat(repr, o)
        else:
            o_repr="REPR ERROR"
        return "<%s instance at 0x%x with %s error:\n %s>\n\nsafe_repr: %s" % (
            className, unsignedID(o), formatter.__name__, tbValue, o_repr)

Original comment by jason-go...@creativetrax.com on 13 Dec 2011 at 8:32

GoogleCodeExporter commented 8 years ago
This was fixed in 
http://code.google.com/r/jasongrout-flask-sagenb/source/detail?r=7572546075d8537
841bfb0151eb4a7312a898fa0

Original comment by jason-go...@creativetrax.com on 15 Dec 2011 at 2:08

GoogleCodeExporter commented 8 years ago
This was fixed in 
http://code.google.com/r/jasongrout-flask-sagenb/source/detail?r=7572546075d8537
841bfb0151eb4a7312a898fa0

Original comment by jason-go...@creativetrax.com on 15 Dec 2011 at 2:08

GoogleCodeExporter commented 8 years ago
William reviewed the latest git notebook.

Original comment by jason-go...@creativetrax.com on 10 Jan 2012 at 4:14