@@ -65,40 +65,41 @@ \section{\module{codecs} ---
6565To simplify working with encoded files or stream, the module
6666also defines these utility functions:
6767
68- \begin {funcdesc }{open}{filename, mode\optional {, encoding=None\optional {, errors='strict'\optional {, buffering=1}}}}
68+ \begin {funcdesc }{open}{filename, mode\optional {, encoding\optional {,
69+ errors\optional {, buffering}}}}
6970Open an encoded file using the given \var {mode} and return
7071a wrapped version providing transparent encoding/decoding.
7172
7273\strong {Note:} The wrapped version will only accept the object format
73- defined by the codecs, i.e. Unicode objects for most builtin
74- codecs. Output is also codec dependent and will usually by Unicode as
74+ defined by the codecs, i.e.\ Unicode objects for most built-in
75+ codecs. Output is also codec- dependent and will usually be Unicode as
7576well.
7677
7778\var {encoding} specifies the encoding which is to be used for the
7879the file.
7980
8081\var {errors} may be given to define the error handling. It defaults
81- to 'strict' which causes a \exception {ValueError} to be raised in case
82- an encoding error occurs.
82+ to \code { 'strict'} which causes a \exception {ValueError} to be raised
83+ in case an encoding error occurs.
8384
8485\var {buffering} has the same meaning as for the built-in
8586\function {open()} function. It defaults to line buffered.
8687\end {funcdesc }
8788
88- \begin {funcdesc }{EncodedFile}{file, input\optional {, output=None \optional {, errors='strict'}}}
89-
89+ \begin {funcdesc }{EncodedFile}{file, input\optional {,
90+ output \optional {, errors}}}
9091Return a wrapped version of file which provides transparent
9192encoding translation.
9293
9394Strings written to the wrapped file are interpreted according to the
9495given \var {input} encoding and then written to the original file as
95- string using the \var {output} encoding. The intermediate encoding will
96+ strings using the \var {output} encoding. The intermediate encoding will
9697usually be Unicode but depends on the specified codecs.
9798
98- If \var {output} is not given, it defaults to input.
99+ If \var {output} is not given, it defaults to \var { input} .
99100
100101\var {errors} may be given to define the error handling. It defaults to
101- 'strict' which causes \exception {ValueError} to be raised in case
102+ \code { 'strict'}, which causes \exception {ValueError} to be raised in case
102103an encoding error occurs.
103104\end {funcdesc }
104105
0 commit comments