diff Doc/lib/libcsv.tex @ 29747:eb828c64fcc7 legacy-trunk

Note that csv files (when they are actual files) must be opened in 'b'inary mode. Note that the only restriction on the csvfile passed to writer objects is that it have a write method.
author Skip Montanaro <skip@pobox.com>
date Wed, 02 Jul 2003 15:32:48 +0000
parents fdac9b4d3717
children 7b577377d546
line wrap: on
line diff
--- a/Doc/lib/libcsv.tex	Wed Jul 02 15:31:54 2003 +0000
+++ b/Doc/lib/libcsv.tex	Wed Jul 02 15:32:48 2003 +0000
@@ -54,7 +54,9 @@
 Return a reader object which will iterate over lines in the given
 {}\var{csvfile}.  \var{csvfile} can be any object which supports the
 iterator protocol and returns a string each time its \method{next}
-method is called.  An optional \var{dialect} parameter can be given
+method is called.  If \var{csvfile} is a file object, it must be opened with
+the 'b' flag on platforms where that makes a difference.  An optional
+{}\var{dialect} parameter can be given
 which is used to define a set of parameters specific to a particular CSV
 dialect.  It may be an instance of a subclass of the \class{Dialect}
 class or one of the strings returned by the \function{list_dialects}
@@ -71,7 +73,10 @@
 \begin{funcdesc}{writer}{csvfile\optional{,
                          dialect=\code{'excel'}\optional{, fmtparam}}}
 Return a writer object responsible for converting the user's data into
-delimited strings on the given file-like object.  An optional
+delimited strings on the given file-like object.  \var{csvfile} can be any
+object with a \function{write} method.  If \var{csvfile} is a file object,
+it must be opened with the 'b' flag on platforms where that makes a
+difference.  An optional
 {}\var{dialect} parameter can be given which is used to define a set of
 parameters specific to a particular CSV dialect.  It may be an instance
 of a subclass of the \class{Dialect} class or one of the strings
@@ -125,7 +130,7 @@
 added as a sequence keyed by the value of \var{restkey}.  If the row read
 has fewer fields than the fieldnames sequence, the remaining keys take the
 value of the optiona \var{restval} parameter.  All other parameters are
-interpreted as for regular readers.
+interpreted as for \class{reader} objects.
 \end{classdesc}
 
 
@@ -143,7 +148,7 @@
 \var{extrasaction} parameter indicates what action to take.  If it is set
 to \code{'raise'} a \exception{ValueError} is raised.  If it is set to
 \code{'ignore'}, extra values in the dictionary are ignored.  All other
-parameters are interpreted as for regular writers.
+parameters are interpreted as for \class{writer} objects.
 \end{classdesc}
 
 \begin{classdesc*}{Dialect}{}