Before the change, profanity has shown `TypeError: prof_pre_chat_message_display() missing 3 required positional arguments: 'barejid', 'resource', and 'message'` error for received messages with incorrect encoding instead of proper error handling for string convertion. That is a temporary fix, correct fix probably would be passing potentially problematic char* as `bytes` (using `y` instead of `s` format), but this would require API changes and hence correction of plugins to handle new input parameters properly (likely with "decode" function). A bit hard to reproduce. You need to add a plugin with the following code (or any other plugin with `prof_pre_chat_message_display` present, such as emoticons.py): ```python def prof_pre_chat_message_display(barejid, resource, message): return message ``` and then receive/send message with incorrectly encoded character, it can be any invalid UTF8 symbol. You'll see error in console, errors don't represent actual errors in plugins, but rather Profanity's shortcoming, though it make appear so that the problem is in plugin. Actual proper handling would likely be using `y` instead of `s` format (see [reference](https://docs.python.org/3/c-api/arg.html#c.Py_BuildValue)) > s ([str](https://docs.python.org/3/library/stdtypes.html#str) or None) [const char *] > Convert a null-terminated C string to a Python [str](https://docs.python.org/3/library/stdtypes.html#str) object using 'utf-8' encoding. If the C string pointer is NULL, None is used. to > y ([bytes](https://docs.python.org/3/library/stdtypes.html#bytes)) [const char *] > This converts a C string to a Python [bytes](https://docs.python.org/3/library/stdtypes.html#bytes) > object. If the C string pointer is NULL, None is returned. since there is a [problem](https://docs.python.org/3/c-api/arg.html) with `s`: > s ([str](https://docs.python.org/3/library/stdtypes.html#str)) [const char *] > Convert a Unicode object to a C pointer to a character string. > A pointer to an existing string is stored in the character pointer variable whose address you pass. > ... Unicode objects are converted to C strings using 'utf-8' encoding. > **If this conversion fails**, a [UnicodeError](https://docs.python.org/3/library/exceptions.html#UnicodeError) is raised. In python such problem can be handled using `errors='ignore'` in [bytes.decode](https://docs.python.org/3/library/stdtypes.html#bytes.decode) or in a more sophisticated manner, depending on needs and realization.