Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9aa8543

Browse files
committed
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.
1 parent ae14230 commit 9aa8543

1 file changed

Lines changed: 21 additions & 16 deletions

File tree

Doc/lib/libfuncs.tex

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -434,18 +434,23 @@ \section{Built-in Functions \label{built-in-funcs}}
434434
ignored). If the file cannot be opened, \exception{IOError} is
435435
raised.
436436

437-
If \var{mode} is omitted, it defaults to \code{'r'}.
438-
The optional \var{bufsize} argument specifies the file's desired
439-
buffer size: 0 means unbuffered, 1 means line buffered, any other
440-
positive value means use a buffer of (approximately) that size. A
441-
negative \var{bufsize} means to use the system default, which is
442-
usually line buffered for for tty devices and fully buffered for other
443-
files. If omitted, the system default is used.%
444-
\footnote{Specifying a buffer size currently has no effect on systems
445-
that don't have \cfunction{setvbuf()}. The interface to specify the buffer
446-
size is not done using a method that calls \cfunction{setvbuf()}, because
447-
that may dump core when called after any I/O has been performed, and
448-
there's no reliable way to determine whether this is the case.}
437+
If \var{mode} is omitted, it defaults to \code{'r'}. When opening a
438+
binary file, you should append \code{'b'} to the \var{mode} value
439+
for improved portability. (It's useful even on systems which don't
440+
treat binary and text files differently, where it serves as
441+
documentation.) The optional \var{bufsize} argument specifies the
442+
file's desired buffer size: 0 means unbuffered, 1 means line
443+
buffered, any other positive value means use a buffer of
444+
(approximately) that size. A negative \var{bufsize} means to use
445+
the system default, which is usually line buffered for for tty
446+
devices and fully buffered for other files. If omitted, the system
447+
default is used.\footnote{
448+
Specifying a buffer size currently has no effect on systems that
449+
don't have \cfunction{setvbuf()}. The interface to specify the
450+
buffer size is not done using a method that calls
451+
\cfunction{setvbuf()}, because that may dump core when called
452+
after any I/O has been performed, and there's no reliable way to
453+
determine whether this is the case.}
449454
\end{funcdesc}
450455

451456
\begin{funcdesc}{ord}{c}
@@ -649,10 +654,10 @@ \section{Built-in Functions \label{built-in-funcs}}
649654
argument (or anything else that has a \member{__dict__} attribute),
650655
returns a dictionary corresponding to the object's symbol table.
651656
The returned dictionary should not be modified: the effects on the
652-
corresponding symbol table are undefined.%
653-
\footnote{In the current implementation, local variable bindings
654-
cannot normally be affected this way, but variables retrieved from
655-
other scopes (e.g. modules) can be. This may change.}
657+
corresponding symbol table are undefined.\footnote{
658+
In the current implementation, local variable bindings cannot
659+
normally be affected this way, but variables retrieved from
660+
other scopes (e.g. modules) can be. This may change.}
656661
\end{funcdesc}
657662

658663
\begin{funcdesc}{xrange}{\optional{start,} stop\optional{, step}}

0 commit comments

Comments
 (0)