Error: pull_from_email_account TypeError: Incorrect padding\n

I get this error in my error log:
{‘retry’: 0, ‘log’: <function log at 0x7fbf73631578>, ‘site’: u’erp.parsimony.com’, ‘event’: u’all’, ‘method_name’: u’pull_from_email_account’, ‘method’: <function pull_from_email_account at 0x7fbf72b4e668>, ‘user’: u’Administrator’, ‘kwargs’: {‘email_account’: u’Michael’}, ‘async’: True, ‘job_name’: u’pull_from_email_account|Michael’}
Traceback (most recent call last):
File “/home/admin/frappe-bench/apps/frappe/frappe/utils/background_jobs.py”, line 97, in execute_job
method(*kwargs)
File “/home/admin/frappe-bench/apps/frappe/frappe/email/doctype/email_account/email_account.py”, line 707, in pull_from_email_account
email_account.receive()
File “/home/admin/frappe-bench/apps/frappe/frappe/email/doctype/email_account/email_account.py”, line 298, in receive
raise Exception(frappe.as_json(exceptions))
Exception: [
"Traceback (most recent call last):\n File "/home/admin/frappe-bench/apps/frappe/frappe/email/doctype/email_account/email_account.py", line 275, in receive\n communication = self.insert_communication(msg, args=args)\n File "/home/admin/frappe-bench/apps/frappe/frappe/email/doctype/email_account/email_account.py", line 383, in insert_communication\n communication.insert(ignore_permissions = 1)\n File "/home/admin/frappe-bench/apps/frappe/frappe/model/document.py", line 222, in insert\n self._validate()\n File "/home/admin/frappe-bench/apps/frappe/frappe/model/document.py", line 446, in _validate\n self._extract_images_from_text_editor()\n File "/home/admin/frappe-bench/apps/frappe/frappe/model/base_document.py", line 787, in _extract_images_from_text_editor\n extract_images_from_doc(self, df.fieldname)\n File "/home/admin/frappe-bench/apps/frappe/frappe/utils/file_manager.py", line 351, in extract_images_from_doc\n content = extract_images_from_html(doc, content)\n File "/home/admin/frappe-bench/apps/frappe/frappe/utils/file_manager.py", line 384, in extract_images_from_html\n content = re.sub('<img[^>]src\s=\s
"\'(.*?)["\‘]’, _save_file, content)\n File "/home/admin/frappe-bench/env/lib/python2.7/re.py", line 155, in sub\n return _compile(pattern, flags).sub(repl, string, count)\n File "/home/admin/frappe-bench/apps/frappe/frappe/utils/file_manager.py", line 377, in _save_file\n file_url = save_file(filename, content, doctype, name, decode=True).get("file_url")\n File "/home/admin/frappe-bench/apps/frappe/frappe/utils/file_manager.py", line 126, in save_file\n content = base64.b64decode(content)\n File "/usr/lib/python2.7/base64.py", line 78, in b64decode\n raise TypeError(msg)\nTypeError: Incorrect padding\n"

It will be absent for days and days and suddenly show up again many times in one day. I can’t tell if it is generated by an individual bad email message or by a script in our installation. Would appreciate any help. Thanks.

and

are similar items which may help.

Have you updated any OS libraries recently?