-
-
Notifications
You must be signed in to change notification settings - Fork 32.7k
bpo-36348: IMAP4.logout() doesn't ignore exc #12411
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -625,11 +625,8 @@ def logout(self): | |||
Returns server 'BYE' response. | |||
""" | |||
self.state = 'LOGOUT' | |||
try: typ, dat = self._simple_command('LOGOUT') | |||
except: typ, dat = 'NO', ['%s: %s' % sys.exc_info()[:2]] | |||
typ, dat = self._simple_command('LOGOUT') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
title: "does not ignore"? |
The imap.IMAP4.logout() method no longer ignores silently arbitrary exceptions. Changes: * The IMAP4.logout() method now expects a "BYE" untagged response, rather than relying on _check_bye() which raises a self.abort() exception. * IMAP4.__exit__() now does nothing if the client already logged out. * Add more debug info if test_logout() tests fail.
I'm not sure if this change will fix the random failures on buildbot, since _command() wraps socket exceptions into self.abort(). Example if you revert my
|
I tried but failed to reproduce the buildbot failure: https://bugs.python.org/issue36348#msg338233 I ran "./python -u -m test -u all -m test_logout -v test_imaplib" 4 times in parallel and I modified the tests to remove transient_internet(). |
I plan to merge this PR at the end of the week. @bitdancer, @warsaw: Would you mind to have a look? |
The imap.IMAP4.logout() method no longer ignores silently arbitrary
exceptions.
Changes:
rather than relying on _check_bye() which raises a self.abort()
exception.
https://bugs.python.org/issue36348