From 9aa8543c842d08f24ccc5a707fd557d8c4c84cc4 Mon Sep 17 00:00:00 2001 From: Fred Drake Date: Mon, 5 Apr 1999 21:22:41 +0000 Subject: open() description: Made it more clear that 'b' should always be added to the mode value for binary files to improve portability. Fixed latex2html weirdness with a couple of footnotes. --- Doc/lib/libfuncs.tex | 37 +++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/Doc/lib/libfuncs.tex b/Doc/lib/libfuncs.tex index f195740..df384af 100644 --- a/Doc/lib/libfuncs.tex +++ b/Doc/lib/libfuncs.tex @@ -434,18 +434,23 @@ one argument, return the smallest of the arguments. ignored). If the file cannot be opened, \exception{IOError} is raised. -If \var{mode} is omitted, it defaults to \code{'r'}. -The optional \var{bufsize} argument specifies the file's desired -buffer size: 0 means unbuffered, 1 means line buffered, any other -positive value means use a buffer of (approximately) that size. A -negative \var{bufsize} means to use the system default, which is -usually line buffered for for tty devices and fully buffered for other -files. If omitted, the system default is used.% -\footnote{Specifying a buffer size currently has no effect on systems -that don't have \cfunction{setvbuf()}. The interface to specify the buffer -size is not done using a method that calls \cfunction{setvbuf()}, because -that may dump core when called after any I/O has been performed, and -there's no reliable way to determine whether this is the case.} + If \var{mode} is omitted, it defaults to \code{'r'}. When opening a + binary file, you should append \code{'b'} to the \var{mode} value + for improved portability. (It's useful even on systems which don't + treat binary and text files differently, where it serves as + documentation.) The optional \var{bufsize} argument specifies the + file's desired buffer size: 0 means unbuffered, 1 means line + buffered, any other positive value means use a buffer of + (approximately) that size. A negative \var{bufsize} means to use + the system default, which is usually line buffered for for tty + devices and fully buffered for other files. If omitted, the system + default is used.\footnote{ + Specifying a buffer size currently has no effect on systems that + don't have \cfunction{setvbuf()}. The interface to specify the + buffer size is not done using a method that calls + \cfunction{setvbuf()}, because that may dump core when called + after any I/O has been performed, and there's no reliable way to + determine whether this is the case.} \end{funcdesc} \begin{funcdesc}{ord}{c} @@ -649,10 +654,10 @@ local symbol table. With a module, class or class instance object as argument (or anything else that has a \member{__dict__} attribute), returns a dictionary corresponding to the object's symbol table. The returned dictionary should not be modified: the effects on the -corresponding symbol table are undefined.% -\footnote{In the current implementation, local variable bindings -cannot normally be affected this way, but variables retrieved from -other scopes (e.g. modules) can be. This may change.} +corresponding symbol table are undefined.\footnote{ + In the current implementation, local variable bindings cannot + normally be affected this way, but variables retrieved from + other scopes (e.g. modules) can be. This may change.} \end{funcdesc} \begin{funcdesc}{xrange}{\optional{start,} stop\optional{, step}} -- cgit v0.12