Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
e2ed9df6
Kaydet (Commit)
e2ed9df6
authored
Agu 26, 1997
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed bugs regarding lines starting with '.' (both receiving and sending).
Added a minimal test function.
üst
e20aef57
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
4 deletions
+25
-4
nntplib.py
Lib/nntplib.py
+25
-4
No files found.
Lib/nntplib.py
Dosyayı görüntüle @
e2ed9df6
...
@@ -137,6 +137,8 @@ class NNTP:
...
@@ -137,6 +137,8 @@ class NNTP:
line
=
self
.
getline
()
line
=
self
.
getline
()
if
line
==
'.'
:
if
line
==
'.'
:
break
break
if
line
[:
2
]
==
'..'
:
line
=
line
[
1
:]
list
.
append
(
line
)
list
.
append
(
line
)
return
resp
,
list
return
resp
,
list
...
@@ -407,8 +409,8 @@ class NNTP:
...
@@ -407,8 +409,8 @@ class NNTP:
break
break
if
line
[
-
1
]
==
'
\n
'
:
if
line
[
-
1
]
==
'
\n
'
:
line
=
line
[:
-
1
]
line
=
line
[:
-
1
]
if
line
==
'.'
:
if
line
[:
1
]
==
'.'
:
line
=
'.
.'
line
=
'.
'
+
line
self
.
putline
(
line
)
self
.
putline
(
line
)
self
.
putline
(
'.'
)
self
.
putline
(
'.'
)
return
self
.
getresp
()
return
self
.
getresp
()
...
@@ -431,8 +433,8 @@ class NNTP:
...
@@ -431,8 +433,8 @@ class NNTP:
break
break
if
line
[
-
1
]
==
'
\n
'
:
if
line
[
-
1
]
==
'
\n
'
:
line
=
line
[:
-
1
]
line
=
line
[:
-
1
]
if
line
==
'.'
:
if
line
[:
1
]
==
'.'
:
line
=
'.
.'
line
=
'.
'
+
line
self
.
putline
(
line
)
self
.
putline
(
line
)
self
.
putline
(
'.'
)
self
.
putline
(
'.'
)
return
self
.
getresp
()
return
self
.
getresp
()
...
@@ -446,3 +448,22 @@ class NNTP:
...
@@ -446,3 +448,22 @@ class NNTP:
self
.
sock
.
close
()
self
.
sock
.
close
()
del
self
.
file
,
self
.
sock
del
self
.
file
,
self
.
sock
return
resp
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
"
%7
s
%
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