diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2012-02-12 18:15:09 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2012-02-12 18:15:09 (GMT) |
commit | 425b8e85a99ee0c21a6f805e123d90e35f9f6a9b (patch) | |
tree | d74cc44c1f3f88cb65f60823c746b5ac2f7007a5 /Lib/nntplib.py | |
parent | 2f234db3ebeb2417291bfe31f4a084f5fc280c66 (diff) | |
parent | 54411c1784bc404448f496e7a9bf657eaab14daf (diff) | |
download | cpython-425b8e85a99ee0c21a6f805e123d90e35f9f6a9b.zip cpython-425b8e85a99ee0c21a6f805e123d90e35f9f6a9b.tar.gz cpython-425b8e85a99ee0c21a6f805e123d90e35f9f6a9b.tar.bz2 |
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 19a462d..7ebc621 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() |