Suppressing UnicodeEncodeError raised when warning contains unicode characters