diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2012-02-12 19:15:09 +0100 |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2012-02-12 19:15:09 +0100 |
commit | 425b8e85a99ee0c21a6f805e123d90e35f9f6a9b (patch) | |
tree | d74cc44c1f3f88cb65f60823c746b5ac2f7007a5 /Lib/nntplib.py | |
parent | Merge with remote. (diff) | |
parent | Issue #10287: nntplib now queries the server's CAPABILITIES again after authe... (diff) | |
download | cpython-425b8e85a99ee0c21a6f805e123d90e35f9f6a9b.tar.gz cpython-425b8e85a99ee0c21a6f805e123d90e35f9f6a9b.tar.bz2 cpython-425b8e85a99ee0c21a6f805e123d90e35f9f6a9b.zip |
Issue #10287: nntplib now queries the server's CAPABILITIES again after authenticating (since the result may change, according to RFC 4643).
Patch by Hynek Schlawack.
Diffstat (limited to 'Lib/nntplib.py')
-rw-r--r-- | Lib/nntplib.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/nntplib.py b/Lib/nntplib.py index 19a462dd297..7ebc6215fba 100644 --- a/Lib/nntplib.py +++ b/Lib/nntplib.py @@ -378,7 +378,7 @@ class _NNTPBase: self.nntp_implementation = None try: resp, caps = self.capabilities() - except NNTPPermanentError: + except (NNTPPermanentError, NNTPTemporaryError): # Server doesn't support capabilities self._caps = {} else: @@ -955,6 +955,9 @@ class _NNTPBase: resp = self._shortcmd('authinfo pass ' + password) if not resp.startswith('281'): raise NNTPPermanentError(resp) + # Capabilities might have changed after login + self._caps = None + self.getcapabilities() # Attempt to send mode reader if it was requested after login. if self.readermode_afterauth: self._setreadermode() |