cubicweb #3460857 AttributeError: Binary instance has no attribute '__len__' [rejected]

This can happen upon add_attribute or sync_schema

>>> sync_schema_props_perms()
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python2.7/dist-packages/cubicweb/server/migractions.py", line 1194, in cmd_sync_schema_props_perms
    syncprops=syncprops, syncperms=syncperms)
  File "/usr/lib/python2.7/dist-packages/cubicweb/server/migractions.py", line 559, in _synchronize_eschema
    syncprops=syncprops, syncperms=syncperms)
  File "/usr/lib/python2.7/dist-packages/cubicweb/server/migractions.py", line 621, in _synchronize_rdef_schema
    ask_confirm=confirm)
  File "/usr/lib/python2.7/dist-packages/cubicweb/server/migractions.py", line 324, in rqlexecall
    self.rqlexec(rql, kwargs, ask_confirm=ask_confirm)
  File "/usr/lib/python2.7/dist-packages/cubicweb/server/migractions.py", line 1479, in rqlexec
    res = execute(rql, kwargs, build_descr=build_descr)
  File "/usr/lib/python2.7/dist-packages/cubicweb/server/session.py", line 1183, in execute
    rset = self._execute(self, rql, kwargs, build_descr)
  File "/usr/lib/python2.7/dist-packages/cubicweb/server/querier.py", line 642, in execute
    results = plan.execute()
  File "/usr/lib/python2.7/dist-packages/cubicweb/server/querier.py", line 184, in execute
    result = step.execute()
  File "/usr/lib/python2.7/dist-packages/cubicweb/server/ssplanner.py", line 580, in execute
    repo.glob_update_entity(session, edited)
  File "/usr/lib/python2.7/dist-packages/cubicweb/server/repository.py", line 1437, in glob_update_entity
    edited.check()
  File "/usr/lib/python2.7/dist-packages/cubicweb/server/edition.py", line 146, in check
    creation=creation, relations=relations)
  File "/usr/lib/pymodules/python2.7/yams/schema.py", line 547, in check
    if not constraint.check(entity, rschema, value):
  File "/usr/lib/pymodules/python2.7/yams/constraints.py", line 124, in check
    if len(value) > self.max:
AttributeError: Binary instance has no attribute '__len__'
priorityimportant
typebug
done in3.18.3
load0.000
load left0.000
closed by<not specified>
patch[binary] add a __len__ to Binaries [rejected]