Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
1a14815b
Commit
1a14815b
authored
Nov 02, 2010
by
Antoine Pitrou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #10280: NNTP.nntp_version should reflect the highest version
advertised by the server.
parent
0f834476
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
4 deletions
+9
-4
Lib/nntplib.py
Lib/nntplib.py
+3
-1
Lib/test/test_nntplib.py
Lib/test/test_nntplib.py
+3
-3
Misc/NEWS
Misc/NEWS
+3
-0
No files found.
Lib/nntplib.py
View file @
1a14815b
...
...
@@ -361,7 +361,9 @@ class _NNTPBase:
else
:
self
.
_caps
=
caps
if
'VERSION'
in
caps
:
self
.
nntp_version
=
int
(
caps
[
'VERSION'
][
0
])
# The server can advertise several supported versions,
# choose the highest.
self
.
nntp_version
=
max
(
map
(
int
,
caps
[
'VERSION'
]))
def
getwelcome
(
self
):
"""Get the welcome message from the server
...
...
Lib/test/test_nntplib.py
View file @
1a14815b
...
...
@@ -558,7 +558,7 @@ class NNTPv2Handler(NNTPv1Handler):
def
handle_CAPABILITIES
(
self
):
self
.
push_lit
(
"""
\
101 Capability list:
VERSION 2
VERSION 2
3
IMPLEMENTATION INN 2.5.1
AUTHINFO USER
HDR
...
...
@@ -935,7 +935,7 @@ class NNTPv2Tests(NNTPv1v2TestsMixin, MockedNNTPTestsMixin, unittest.TestCase):
def
test_caps
(
self
):
caps
=
self
.
server
.
getcapabilities
()
self
.
assertEqual
(
caps
,
{
'VERSION'
:
[
'2'
],
'VERSION'
:
[
'2'
,
'3'
],
'IMPLEMENTATION'
:
[
'INN'
,
'2.5.1'
],
'AUTHINFO'
:
[
'USER'
],
'HDR'
:
[],
...
...
@@ -945,7 +945,7 @@ class NNTPv2Tests(NNTPv1v2TestsMixin, MockedNNTPTestsMixin, unittest.TestCase):
'POST'
:
[],
'READER'
:
[],
})
self
.
assertEqual
(
self
.
server
.
nntp_version
,
2
)
self
.
assertEqual
(
self
.
server
.
nntp_version
,
3
)
class
MiscTests
(
unittest
.
TestCase
):
...
...
Misc/NEWS
View file @
1a14815b
...
...
@@ -59,6 +59,9 @@ Core and Builtins
Library
-------
- Issue #10280: NNTP.nntp_version should reflect the highest version
advertised by the server.
- Issue #10184: Touch directories only once when extracting a tarfile.
- Issue #10199: New package, ``turtledemo`` now contains selected demo
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment