Message24860
Logged In: YES
user_id=86307
Sorry to comment on a closed report, but perhaps this fix
should not be limited only to cases where size is None.
Today, I ran into a spurious syntax error when trying to
import pythondoc (from
http://effbot.org/downloads/pythondoc-2.1b3-20050325.zip).
It turned out a \r was ending up in what looked to the
parser like the middle of a line, presumably because a \n
was dropped. Anyway, I applied the referenced patch to
2.4.1, except I left out the "size is None" condition, since
I knew the tokenizer passes in a size param. With that
change pythondoc import successfully. (Also, I just ran the
test suite and nothing broke.)
Since the size parameter is already documented as being
passed to StreamReader.read (in codecs.py -- the HTML
documentation needs to be updated), and since
StreamReader.read says size is an approximate maximum,
perhaps it's OK to read one extra byte.
|
|
Date |
User |
Action |
Args |
2007-08-23 14:30:41 | admin | link | issue1175396 messages |
2007-08-23 14:30:41 | admin | create | |
|