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
630a4f63
Kaydet (Commit)
630a4f63
authored
Tem 07, 2014
tarafından
Victor Stinner
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #11259: asynchat.async_chat().set_terminator() now raises a ValueError if
the number of received bytes is negative.
üst
fd5d1b51
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
0 deletions
+13
-0
asynchat.py
Lib/asynchat.py
+2
-0
test_asynchat.py
Lib/test/test_asynchat.py
+8
-0
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/asynchat.py
Dosyayı görüntüle @
630a4f63
...
@@ -99,6 +99,8 @@ class async_chat(asyncore.dispatcher):
...
@@ -99,6 +99,8 @@ class async_chat(asyncore.dispatcher):
"""
"""
if
isinstance
(
term
,
str
)
and
self
.
use_encoding
:
if
isinstance
(
term
,
str
)
and
self
.
use_encoding
:
term
=
bytes
(
term
,
self
.
encoding
)
term
=
bytes
(
term
,
self
.
encoding
)
elif
isinstance
(
term
,
int
)
and
term
<
0
:
raise
ValueError
(
'the number of received bytes must be positive'
)
self
.
terminator
=
term
self
.
terminator
=
term
def
get_terminator
(
self
):
def
get_terminator
(
self
):
...
...
Lib/test/test_asynchat.py
Dosyayı görüntüle @
630a4f63
...
@@ -304,5 +304,13 @@ class TestFifo(unittest.TestCase):
...
@@ -304,5 +304,13 @@ class TestFifo(unittest.TestCase):
self
.
assertEqual
(
f
.
pop
(),
(
0
,
None
))
self
.
assertEqual
(
f
.
pop
(),
(
0
,
None
))
class
TestNotConnected
(
unittest
.
TestCase
):
def
test_disallow_negative_terminator
(
self
):
# Issue #11259
client
=
asynchat
.
async_chat
()
self
.
assertRaises
(
ValueError
,
client
.
set_terminator
,
-
1
)
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
unittest
.
main
()
unittest
.
main
()
Misc/NEWS
Dosyayı görüntüle @
630a4f63
...
@@ -27,6 +27,9 @@ Core and Builtins
...
@@ -27,6 +27,9 @@ Core and Builtins
Library
Library
-------
-------
- Issue #11259: asynchat.async_chat().set_terminator() now raises a ValueError
if the number of received bytes is negative.
- Issue #12523: asynchat.async_chat.push() now raises a TypeError if it doesn'
t
- Issue #12523: asynchat.async_chat.push() now raises a TypeError if it doesn'
t
get
a
bytes
string
get
a
bytes
string
...
...
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