Closed clarified closed 1 year ago
When I looked at this a tad more carefully, I realized that this is just a problem with offlineimap and python3. It occurs when the refresh token expires.
Nothing to do with M365-IMAP. So closing. Sorry for the noise.
Offlineimap3 problem, not M365-IMAP.
I have just upgraded a debian testing system, and offlineimap then fails to downoad from an outlook.office365.com server with an error ERROR: AttributeError: 'str' object has no attribute '__suppress_context__'
The upgrade included the debian package python3-pyparsing version 3.1.1-1 which I suspect may be the problem.
========================================================= Here are the errors including the backtrace: Establishing connection to outlook.office365.com:993 (XXXXXXX) ERROR: HTTP Error 400: Bad Request (configuration is: {'client_id': 'xxx', 'client_secret': 'xxxxxx', 'refresh_token': 'xxxxxxxx', 'grant_type': 'refresh_token'}) ERROR: While attempting to sync account 'xxxxxxx' HTTP Error 400: Bad Request *** Finished account 'xxxx' in 0:00 ERROR: Exceptions occurred during the run! ERROR: 'str' object has no attribute '__suppress_context__' ERROR: Exceptions occurred during the run! ERROR: While attempting to sync account 'xxxx' urllib.error.HTTPError: HTTP Error 400: Bad Request
Traceback: File "/usr/share/offlineimap3/offlineimap/accounts.py", line 298, in syncrunner self.sync() File "/usr/share/offlineimap3/offlineimap/accounts.py", line 375, in sync remoterepos.getfolders() File "/usr/share/offlineimap3/offlineimap/repository/IMAP.py", line 681, in getfolders imapobj = self.imapserver.acquireconnection() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/share/offlineimap3/offlineimap/imapserver.py", line 593, in acquireconnection self.authn_helper(imapobj) File "/usr/share/offlineimap3/offlineimap/imapserver.py", line 445, in __authn_helper if func(imapobj): ^^^^^^^^^^^^^ File "/usr/share/offlineimap3/offlineimap/imapserver.py", line 379, in authn_xoauth2 imapobj.authenticate('XOAUTH2', self.xoauth2handler) File "/usr/lib/python3/dist-packages/imaplib2.py", line 691, in authenticate typ, dat = self._simple_command('AUTHENTICATE', mechanism.upper()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/imaplib2.py", line 1684, in _simple_command return self._command_complete(self._command(name, *args), kw) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/imaplib2.py", line 1404, in _command literal = literator(data, rqb) ^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/imaplib2.py", line 2247, in process ret = self.mech(self.decode(data)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/share/offlineimap3/offlineimap/imapserver.py", line 249, in xoauth2handler response = urllib.request.urlopen( ^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/urllib/request.py", line 216, in urlopen return opener.open(url, data, timeout) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/urllib/request.py", line 525, in open response = meth(req, response) ^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/urllib/request.py", line 634, in http_response response = self.parent.error( ^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/urllib/request.py", line 563, in error return self._call_chain(args) ^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/urllib/request.py", line 496, in _call_chain result = func(args) ^^^^^^^^^^^ File "/usr/lib/python3.11/urllib/request.py", line 643, in http_error_default raise HTTPError(req.full_url, code, msg, hdrs, fp)
ERROR: AttributeError: 'str' object has no attribute '__suppress_context__' :waffle: