Athena Unicode problem with LatinX messages from browser
Hello, This is only for information if somebody get same problem how to make non-ascii JS error visible. I found per coincidence a weakness in athena message handling. This happen, when browser report JS error with non-ascii characters: # --------------------------- Traceback (most recent call last): Failure: nevow.athena.JSException: <JSException instance at 52468224 with str error Traceback (most recent call last): File "/usr/lib/python2.6/dist-packages/twisted/python/reflect.py", line 561, in safe_str return str(o) UnicodeEncodeError: 'ascii' codec can't encode character u'\xe1' in position 12: ordinal not in range(128) # --------------------------- and you do NOT see the error message from browser to fix the problem. In my case, the message from browser was: "Chybná hodnota vlastnosti." To see, what is going on i added to my errBackPrintError function: print '%r' % error and get now: ... JSException(u'Error: Chybn\xe1 hodnota vlastnosti.',) so I can see, what is going on. Regards, Paul
I think it is a bug, I think I also ran into it some time ago. Could you please file a bug report at http://www.divmod.org/ ? -- M -----Original Message----- From: twisted-web-bounces@twistedmatrix.com [mailto:twisted-web-bounces@twistedmatrix.com] On Behalf Of Paul Reznicek Sent: Thursday, July 02, 2009 12:37 PM To: Twisted-web@twistedmatrix.com Subject: [Twisted-web] Athena Unicode problem with LatinX messages from browser Hello, This is only for information if somebody get same problem how to make non-ascii JS error visible. I found per coincidence a weakness in athena message handling. This happen, when browser report JS error with non-ascii characters: # --------------------------- Traceback (most recent call last): Failure: nevow.athena.JSException: <JSException instance at 52468224 with str error Traceback (most recent call last): File "/usr/lib/python2.6/dist-packages/twisted/python/reflect.py", line 561, in safe_str return str(o) UnicodeEncodeError: 'ascii' codec can't encode character u'\xe1' in position 12: ordinal not in range(128) # --------------------------- and you do NOT see the error message from browser to fix the problem. In my case, the message from browser was: "Chybná hodnota vlastnosti." To see, what is going on i added to my errBackPrintError function: print '%r' % error and get now: ... JSException(u'Error: Chybn\xe1 hodnota vlastnosti.',) so I can see, what is going on. Regards, Paul _______________________________________________ Twisted-web mailing list Twisted-web@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web
participants (2)
-
Michał Pasternak
-
Paul Reznicek