summaryrefslogtreecommitdiffstats
path: root/Lib/nntplib.py
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2012-02-12 18:14:17 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2012-02-12 18:14:17 (GMT)
commit54411c1784bc404448f496e7a9bf657eaab14daf (patch)
treee7917bd18d0652cbbfe6883d9c8e4a7073583a95 /Lib/nntplib.py
parent9ce366a5a691fb929c41d7f2c065bcbbddc81026 (diff)
downloadcpython-54411c1784bc404448f496e7a9bf657eaab14daf.zip
cpython-54411c1784bc404448f496e7a9bf657eaab14daf.tar.gz
cpython-54411c1784bc404448f496e7a9bf657eaab14daf.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.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/nntplib.py b/Lib/nntplib.py
index bf66734..6b0150d 100644
--- a/Lib/nntplib.py
+++ b/Lib/nntplib.py
@@ -364,7 +364,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:
@@ -941,6 +941,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()