We discussed this a little over private email. The fix is important
enough to post to the whole group -- a new bug in 1.0.2 causes a loop
in the tokenizer when the last line doesn't end in '\n'. Here's a
patch.
*** 2.14.2.3 1994/04/28 12:31:46
--- tokenizer.c 1994/05/23 12:40:51
***************
*** 267,274 ****
tok->buf + curstart;
if (fgets(tok->inp,
(int)(tok->end - tok->inp),
! tok->fp) == NULL)
! break;
tok->inp = strchr(tok->inp, '\0');
done = tok->inp[-1] == '\n';
}
--- 267,277 ----
tok->buf + curstart;
if (fgets(tok->inp,
(int)(tok->end - tok->inp),
! tok->fp) == NULL) {
! /* Last line does not end in \n,
! fake one */
! strcpy(tok->inp, "\n");
! }
tok->inp = strchr(tok->inp, '\0');
done = tok->inp[-1] == '\n';
}
--Guido van Rossum, CWI, Amsterdam <Guido.van.Rossum@cwi.nl>
URL: <http://www.cwi.nl/cwi/people/Guido.van.Rossum.html>