TypeError: not all arguments converted during string formatting

I see a bunch of events like this on a brand new Plone 5.1.2 instance:

Traceback (most recent call last):
  File "/home/hvelarde/collective/buildout.python/parts/opt/lib/python2.7/logging/__init__.py", line 861, in emit
    msg = self.format(record)
  File "/home/hvelarde/collective/buildout.python/parts/opt/lib/python2.7/logging/__init__.py", line 734, in format
    return fmt.format(record)
  File "/home/hvelarde/collective/buildout.python/parts/opt/lib/python2.7/logging/__init__.py", line 465, in format
    record.message = record.getMessage()
  File "/home/hvelarde/collective/buildout.python/parts/opt/lib/python2.7/logging/__init__.py", line 329, in getMessage
    msg = msg % self.args
TypeError: not all arguments converted during string formatting
Logged from file widget.py, line 49

any idea?

I found the following doing a quick search:

$ find -L parts/omelette/ -name widget.py | xargs -l -I % sh -c 'echo "\nfile:" %; sed -n "48,+3p" %'

file: parts/omelette/Products/Archetypes/generator/widget.py
    _properties = {
        'description': '',
        'label': '',
        'visible': {'edit': 'visible', 'view': 'visible'},

file: parts/omelette/plone/app/relationfield/widget.py
            # If we already have a relation, just set the to_id
            current.to_id = to_id
            # otherwise create a relationship

file: parts/omelette/plone/app/z3cform/widget.py
from z3c.form.term import Terms
from z3c.form.widget import FieldWidget
from z3c.form.widget import Widget
from zope.component import adapter

file: parts/omelette/plone/app/z3cform/wysiwyg/widget.py
        'will be removed in Plone 5.1',
    return z3c.form.widget.FieldWidget(field, WysiwygWidget(request))

file: parts/omelette/plone/app/textfield/widget.py
        # We'll wrap context in the current site *if* it's not already
        # wrapped.  This allows the template to acquire tools with
        # ``context/portal_this`` if context is not wrapped already.
        # Any attempts to satisfy the Kupu template in a less idiotic

file: parts/omelette/plone/z3cform/widget.py
    return z3c.form.widget.FieldWidget(field, SingleCheckBoxWidget(request))

# BBB:
singlecheckboxwidget_factory = SingleCheckBoxFieldWidget

file: parts/omelette/plone/formwidget/namedfile/widget.py
    e.g. when it's base64 encoded data.
    if isinstance(value, basestring) and IASCII.providedBy(field):
        filename, data = b64decode_file(value)

file: parts/omelette/plone/formwidget/recurrence/at/widget.py
        return json.dumps({
            "locationization": translations(request),

file: parts/omelette/plone/formwidget/recurrence/z3cform/widget.py

        .. Note::
            This value is likely to be overwritten by the widget configuration.

file: parts/omelette/z3c/form/widget.py
    label = FieldProperty(interfaces.IWidget['label'])
    mode = FieldProperty(interfaces.IWidget['mode'])
    required = FieldProperty(interfaces.IWidget['required'])
    error = FieldProperty(interfaces.IWidget['error'])

file: parts/omelette/z3c/form/browser/widget.py
        It is also possible if more then one (empty space separated) names
        are given as klass argument.

        This method can get used from your form or widget template or widget

file: parts/omelette/z3c/formwidget/query/widget.py
        self.form = form
        self.field = field
        self.widget = widget

UPDATE: I just fixed the lines fetched from the files as I made a mistake on the command.

mmm, seems the problem could be the plone.app.z3cform.wysiwyg.WysiwygFieldWidget I'm using for this:

according to the code that should have been removed from Plone 5.1, but is still there:

can somebody point me to the right import?

what's the 'right' import ? this is a Plone bug (should have been warning.warn), if you use this widget under Plone 5.1 it will display this message. It seems that there should be a way to silent the exception from what there is in
see circa line 800 (on my system)
#raiseExceptions is used to see if exceptions during handling should be

raiseExceptions = 1

maybe it's possible to silent the message at the python level.

obviously, the right import is a widget that has the same functionality and is not deprecated.

so… silencing exceptions is the new way to solve bugs?

From what I understood from your own remarks, the only alternative is between RichText (very difficult to use) and Wisywig (deprecation warning)
About the bug, I don't think there is any way to solve it as any bug report 'solution' will be a removal of the deprecated code. And this is the universal way to solving bugs these days: remove the buggy fonctionality.
And if you don't start in debug mode, no one will hear your Plone cry. And everything will work except that you will miss the deprecation warning in the logs. You know already this anyway and your users don't need to know.

the solution is here: