AttributeError: module 'base64' has no attribute 'encodestring'
1.7.20210509 on Debian Bullseye amd64
Summary
Whilst in the initial process of creating the database via web interface there is an incorrectly reported error on the web interface of Database creation error: Wrong value for base.language.install.lang: 'en_US'
but examining the logs shows many Python exceptions with the first being due to a missing method base64.encodestring
Steps to reproduce Install Debian package on Bullseye and fix up all preceding bugs (see our other reported issues).
What is the current bug behavior? Fails to create the database and reports a wrong error to the web interface.
What is the expected correct behavior? No error.
Relevant logs and/or screenshots
2021-05-21 05:23:35,427 15257 INFO elloe.vision flectra.modules.loading: loading base/security/base_security.xml
2021-05-21 05:23:36,049 15257 INFO elloe.vision flectra.modules.loading: loading base/base_menu.xml
2021-05-21 05:23:36,061 15257 WARNING elloe.vision flectra.modules.loading: Transient module states were reset
2021-05-21 05:23:36,064 15257 ERROR elloe.vision flectra.modules.registry: Failed to load registry
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/flectra/tools/convert.py", line 745, in parse
self._tags[rec.tag](rec, de, mode=mode)
File "/usr/lib/python3/dist-packages/flectra/tools/convert.py", line 502, in _tag_menuitem
pid = self.env['ir.model.data']._update('ir.ui.menu', self.module, values, rec_id, noupdate=self.isnoupdate(data_node), mode=self.mode, res_id=res and res[0] or False)
File "/usr/lib/python3/dist-packages/flectra/addons/base/ir/ir_model.py", line 1527, in _update
record = record.create(values)
File "/usr/lib/python3/dist-packages/flectra/addons/base/ir/ir_ui_menu.py", line 176, in create
values['web_icon_data'] = self._compute_web_icon_data(values.get('web_icon'))
File "/usr/lib/python3/dist-packages/flectra/addons/base/ir/ir_ui_menu.py", line 194, in _compute_web_icon_data
return self.read_image(web_icon)
File "/usr/lib/python3/dist-packages/flectra/addons/base/ir/ir_ui_menu.py", line 97, in read_image
icon_image = base64.encodestring(icon_file.read())
AttributeError: module 'base64' has no attribute 'encodestring'
During handling of the above exception, another exception occurred:
Possible fixes
Correct error report in the web interface and use the correct method base64.b64encode
(and related base64.b64decode
)
Found mention of the true cause at;