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>
Logged In: YES user_id=11375 Surely in your patched version, the code should be 'if not terminator: ...'. Otherwise the patch reverses the sense of the test.
Logged In: YES user_id=113859 Yes, of course. I stopped experimenting with numeric and empty string terminators after hitting this bug, so I uploaded the flawed fix.