hashlib.md5 fails with xmlrpclib.Binary as input Type
tryton version: 5.0.7
proteus version: 5.0.3
after i try to add a new attachment to a model (with proteus). trytond shows this Traceback.
Traceback (most recent call last):
File "/home/tryton/staging/trytond/5.0/venv/lib/python3.7/site-packages/trytond/protocols/dispatcher.py", line 176, in _dispatch
result = rpc.result(meth(*c_args, **c_kwargs))
File "/home/tryton/staging/trytond/5.0/venv/lib/python3.7/site-packages/trytond/ir/resource.py", line 96, in create
records = super(ResourceMixin, cls).create(vlist)
File "/home/tryton/staging/trytond/5.0/venv/lib/python3.7/site-packages/trytond/model/modelsql.py", line 147, in wrapper
return func(cls, *args, **kwargs)
File "/home/tryton/staging/trytond/5.0/venv/lib/python3.7/site-packages/trytond/model/modelsql.py", line 645, in create
field.set(cls, fname, *fargs)
File "/home/tryton/staging/trytond/5.0/venv/lib/python3.7/site-packages/trytond/model/fields/binary.py", line 113, in set
filestore.set(value, prefix) if value else None, None]
File "/home/tryton/staging/trytond/5.0/venv/lib/python3.7/site-packages/trytond/filestore.py", line 31, in set
id = self._id(data)
File "/home/tryton/staging/trytond/5.0/venv/lib/python3.7/site-packages/trytond/filestore.py", line 63, in _id
return hashlib.md5(data).hexdigest()
TypeError: object supporting the buffer API required
i thing its because the data is a xmlrpclib.Binary Object. When i change the line to hashlib.md5(data.data) it works.
of course only till fp.write(data)