sync_account and retry_single_message only caught imaplib.IMAP4.error from imap.logout(). When the IMAP socket had already timed out, logout() raises OSError: cannot read from timed out object, which escaped the finally cleanup and crashed the sync run.
Add OSError to the except tuple in both locations so cleanup completes cleanly.
Test
tests/test_logout_timeout.py — proves sync_account finishes with completed status when imap.logout() raises OSError. Fails without the fix.
All 52 tests pass.
Paperclip-BIT-33892
## Fix
`sync_account` and `retry_single_message` only caught `imaplib.IMAP4.error` from `imap.logout()`. When the IMAP socket had already timed out, `logout()` raises `OSError: cannot read from timed out object`, which escaped the `finally` cleanup and crashed the sync run.
Add `OSError` to the `except` tuple in both locations so cleanup completes cleanly.
## Test
`tests/test_logout_timeout.py` — proves `sync_account` finishes with `completed` status when `imap.logout()` raises `OSError`. Fails without the fix.
All 52 tests pass.
Paperclip-BIT-33892
The finally block in sync_account and retry_single_message only caught
imaplib.IMAP4.error from imap.logout(). When the underlying socket had
already timed out, logout() raises OSError('cannot read from timed out
object') which escaped the handler and crashed the sync run.
Add OSError to the except tuple so cleanup completes cleanly.
Paperclip-BIT-33892
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Fix
sync_accountandretry_single_messageonly caughtimaplib.IMAP4.errorfromimap.logout(). When the IMAP socket had already timed out,logout()raisesOSError: cannot read from timed out object, which escaped thefinallycleanup and crashed the sync run.Add
OSErrorto theexcepttuple in both locations so cleanup completes cleanly.Test
tests/test_logout_timeout.py— provessync_accountfinishes withcompletedstatus whenimap.logout()raisesOSError. Fails without the fix.All 52 tests pass.
Paperclip-BIT-33892
The finally block in sync_account and retry_single_message only caught imaplib.IMAP4.error from imap.logout(). When the underlying socket had already timed out, logout() raises OSError('cannot read from timed out object') which escaped the handler and crashed the sync run. Add OSError to the except tuple so cleanup completes cleanly. Paperclip-BIT-33892auto-approve: CI success on
3ca283aa41(gitea_auto_approve_open_prs_once.py)auto-approve: CI success on
3ca283aa41(gitea_auto_approve_open_prs_once.py)auto-approve: CI success on
3ca283aa41(gitea_auto_approve_open_prs_once.py)