summaryrefslogtreecommitdiff
path: root/Python/pythonrun.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2001-10-12 20:01:53 +0000
committerGuido van Rossum <guido@python.org>2001-10-12 20:01:53 +0000
commit103572589ff07c72e59a5a1266a4541e3fdb8c66 (patch)
treefc6daf9125b650560b3c8c1771509d67e128588a /Python/pythonrun.c
parenta5cd7bfa87627ccb3e655175699b11d95e3bc2b8 (diff)
downloadcpython-103572589ff07c72e59a5a1266a4541e3fdb8c66.tar.gz
Band-aid solution to SF bug #470634: readlines() on linux requires 2 ^D's.
The problem is that if fread() returns a short count, we attempt another fread() the next time through the loop, and apparently glibc clears or ignores the eof condition so the second fread() requires another ^D to make it see the eof condition. According to the man page (and the C std, I hope) fread() can only return a short count on error or eof. I'm using that in the band-aid solution to avoid calling fread() a second time after a short read. Note that xreadlines() still has this problem: it calls readlines(sizehint) until it gets a zero-length return. Since xreadlines() is mostly used for reading real files, I won't worry about this until we get a bug report.
Diffstat (limited to 'Python/pythonrun.c')
0 files changed, 0 insertions, 0 deletions