From a416341b3067306959397e896bd6b712501bd28c Mon Sep 17 00:00:00 2001 From: "Andrew M. Kuchling" Date: Mon, 10 Mar 2003 15:16:54 +0000 Subject: [PATCH] [Patch #649762] Fix for asynchat endless loop When the null string is used as the terminator, it used to be the same as None, meaning "collect all the data". In the current code, however, it falls into an endless loop; this change reverts to the old behavior. --- Lib/asynchat.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/asynchat.py b/Lib/asynchat.py index 081031a019b..dfe5ea610f4 100644 --- a/Lib/asynchat.py +++ b/Lib/asynchat.py @@ -100,7 +100,7 @@ def handle_read (self): while self.ac_in_buffer: lb = len(self.ac_in_buffer) terminator = self.get_terminator() - if terminator is None: + if terminator is None or terminator == '': # no terminator, collect it all self.collect_incoming_data (self.ac_in_buffer) self.ac_in_buffer = ''