summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorGustavo Niemeyer <gustavo@niemeyer.net>2002-12-16 18:12:53 (GMT)
committerGustavo Niemeyer <gustavo@niemeyer.net>2002-12-16 18:12:53 (GMT)
commit786ddb29c9170a585ca1010bd392fb5a5ff4078c (patch)
treef13b95625431e6be163ae9f0a03118b3f9d13a0d /Doc
parent17c5a33582be263e3d3484f1c16f17dadeea5b6f (diff)
downloadcpython-786ddb29c9170a585ca1010bd392fb5a5ff4078c.zip
cpython-786ddb29c9170a585ca1010bd392fb5a5ff4078c.tar.gz
cpython-786ddb29c9170a585ca1010bd392fb5a5ff4078c.tar.bz2
Fixed bug
[#521782] unreliable file.read() error handling * Objects/fileobject.c (file_read): Clear errors before leaving the loop in all situations, and also check if some data was read before exiting the loop with an EWOULDBLOCK exception. * Doc/lib/libstdtypes.tex * Objects/fileobject.c Document that sometimes a read() operation can return less data than what the user asked, if running in non-blocking mode. * Misc/NEWS Document the fix.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/lib/libstdtypes.tex4
1 files changed, 3 insertions, 1 deletions
diff --git a/Doc/lib/libstdtypes.tex b/Doc/lib/libstdtypes.tex
index a104d85..6dee0c9 100644
--- a/Doc/lib/libstdtypes.tex
+++ b/Doc/lib/libstdtypes.tex
@@ -1205,7 +1205,9 @@ flush the read-ahead buffer.
certain files, like ttys, it makes sense to continue reading after
an \EOF{} is hit.) Note that this method may call the underlying
C function \cfunction{fread()} more than once in an effort to
- acquire as close to \var{size} bytes as possible.
+ acquire as close to \var{size} bytes as possible. Also note that
+ when in non-blocking mode, less data than what was requested may
+ be returned, even if no \var{size} parameter was given.
\end{methoddesc}
\begin{methoddesc}[file]{readline}{\optional{size}}