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
e2ed9df6
Commit
e2ed9df6
authored
Aug 26, 1997
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed bugs regarding lines starting with '.' (both receiving and sending).
Added a minimal test function.
parent
e20aef57
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
4 deletions
+25
-4
Lib/nntplib.py
Lib/nntplib.py
+25
-4
No files found.
Lib/nntplib.py
View file @
e2ed9df6
...
...
@@ -137,6 +137,8 @@ class NNTP:
line
=
self
.
getline
()
if
line
==
'.'
:
break
if
line
[:
2
]
==
'..'
:
line
=
line
[
1
:]
list
.
append
(
line
)
return
resp
,
list
...
...
@@ -407,8 +409,8 @@ class NNTP:
break
if
line
[
-
1
]
==
'
\
n
'
:
line
=
line
[:
-
1
]
if
line
==
'.'
:
line
=
'.
.'
if
line
[:
1
]
==
'.'
:
line
=
'.
'
+
line
self
.
putline
(
line
)
self
.
putline
(
'.'
)
return
self
.
getresp
()
...
...
@@ -431,8 +433,8 @@ class NNTP:
break
if
line
[
-
1
]
==
'
\
n
'
:
line
=
line
[:
-
1
]
if
line
==
'.'
:
line
=
'.
.'
if
line
[:
1
]
==
'.'
:
line
=
'.
'
+
line
self
.
putline
(
line
)
self
.
putline
(
'.'
)
return
self
.
getresp
()
...
...
@@ -446,3 +448,22 @@ class NNTP:
self
.
sock
.
close
()
del
self
.
file
,
self
.
sock
return
resp
# Minimal test function
def
_test
():
s
=
NNTP
(
'news'
)
resp
,
count
,
first
,
last
,
name
=
s
.
group
(
'comp.lang.python'
)
print
resp
print
'Group'
,
name
,
'has'
,
count
,
'articles, range'
,
first
,
'to'
,
last
resp
,
subs
=
s
.
xhdr
(
'subject'
,
first
+
'-'
+
last
)
print
resp
for
item
in
subs
:
print
"%7s %s"
%
item
resp
=
s
.
quit
()
print
resp
# Run the test when run as a script
if
__name__
==
'__main__'
:
_test
()
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