2011/10/25 Michael Ströder <mich...@stroeder.com>:
> HI!
>
> For tracking the cause of a UnicodeWarning I'd like to make the Python
> interpreter to raise an UnicodeError exception with full stack trace. Is there
> a short trick to achieve this?

from exceptions import UnicodeWarning
from warnings import filterwarnings
filterwarnings(action="error", category=UnicodeWarning)

This will cause UnicodeWarnings to be raised as exceptions when they occur.

Cheers,
Chris
--
http://rebertia.com
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to