[Patches] [ python-Patches-649762 ] Fix: asynchat.py: endless loop

noreply@sourceforge.net noreply@sourceforge.net
Fri, 06 Dec 2002 14:37:15 -0800


Patches item #649762, was opened at 2002-12-06 22:57
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=649762&group_id=5470

Category: Library (Lib)
Group: Python 2.2.x
Status: Open
Resolution: None
Priority: 5
Submitted By: Bernhard Reiter (ber)
Assigned to: Nobody/Anonymous (nobody)
Summary: Fix: asynchat.py: endless loop

Initial Comment:
Patch against asynchat.py revision 1.19 in Python SF CVS. 
 
Fixes endless loop when terminator='' is used. 
 
Diagnosis: 
If we do not catch the empty string no buffer will be consumed 
lin line 134 and the while loop does not terminate. 
 
Cure:  
Go back to old behaviour and call collect everything with '' and None. 
 
Background: 
Especially annoying because early versions (rev 1.1, coming with 
python1.5) 
did not have this bug and the comment in set_terminator()  
says that strings of all length are okay (among other things). 
The bug was introduced in rev 1.2. 
 
	Bernhard Reiter <bernhard@intevation.de> 

----------------------------------------------------------------------

>Comment By: Bernhard Reiter (ber)
Date: 2002-12-06 23:37

Message:
Logged In: YES 
user_id=113859

The patch also fixes the terminator=0 problem 
which is similiar. 

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=649762&group_id=5470