[Python-checkins] python/dist/src/Doc/lib libcodecs.tex,1.10,1.11 libexcs.tex,1.48,1.49

doerwalter@users.sourceforge.net doerwalter@users.sourceforge.net
Mon, 02 Sep 2002 06:14:32 -0700


Update of /cvsroot/python/python/dist/src/Doc/lib
In directory usw-pr-cvs1:/tmp/cvs-serv19683/Doc/lib

Modified Files:
	libcodecs.tex libexcs.tex 
Log Message:
PEP 293 implemention (from SF patch http://www.python.org/sf/432401)


Index: libcodecs.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libcodecs.tex,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** libcodecs.tex	4 Jun 2002 15:16:29 -0000	1.10
--- libcodecs.tex	2 Sep 2002 13:14:30 -0000	1.11
***************
*** 18,22 ****
  This module defines base classes for standard Python codecs (encoders
  and decoders) and provides access to the internal Python codec
! registry which manages the codec lookup process.
  
  It defines the following functions:
--- 18,22 ----
  This module defines base classes for standard Python codecs (encoders
  and decoders) and provides access to the internal Python codec
! registry which manages the codec and error handling lookup process.
  
  It defines the following functions:
***************
*** 98,101 ****
--- 98,138 ----
  To simplify working with encoded files or stream, the module
  also defines these utility functions:
+ 
+ \begin{funcdesc}{register_error}{name, error_handler}
+ Register the error handling function \var{error_handler} under the
+ name \var{name}. \vari{error_handler} will be called during encoding
+ and decoding in case of an error, when \var{name} is specified as the
+ errors parameter. \var{error_handler} will be called with an
+ \exception{UnicodeEncodeError}, \exception{UnicodeDecodeError} or
+ \exception{UnicodeTranslateError} instance and must return a tuple
+ with a replacement for the unencodable/undecodable part of the input
+ and a position where encoding/decoding should continue.
+ \end{funcdesc}
+ 
+ \begin{funcdesc}{lookup_error}{name}
+ Return the error handler previously register under the name \var{name}.
+ 
+ Raises a \exception{LookupError} in case the handler cannot be found.
+ \end{funcdesc}
+ 
+ \begin{funcdesc}{strict_errors}{exception}
+ Implements the \code{strict} error handling.
+ \end{funcdesc}
+ 
+ \begin{funcdesc}{replace_errors}{exception}
+ Implements the \code{replace} error handling.
+ \end{funcdesc}
+ 
+ \begin{funcdesc}{ignore_errors}{exception}
+ Implements the \code{ignore} error handling.
+ \end{funcdesc}
+ 
+ \begin{funcdesc}{xmlcharrefreplace_errors_errors}{exception}
+ Implements the \code{xmlcharrefreplace} error handling.
+ \end{funcdesc}
+ 
+ \begin{funcdesc}{backslashreplace_errors_errors}{exception}
+ Implements the \code{backslashreplace} error handling.
+ \end{funcdesc}
  
  \begin{funcdesc}{open}{filename, mode\optional{, encoding\optional{,

Index: libexcs.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libexcs.tex,v
retrieving revision 1.48
retrieving revision 1.49
diff -C2 -d -r1.48 -r1.49
*** libexcs.tex	27 Aug 2002 23:53:23 -0000	1.48
--- libexcs.tex	2 Sep 2002 13:14:30 -0000	1.49
***************
*** 336,339 ****
--- 336,357 ----
  \end{excdesc}
  
+ \begin{excdesc}{UnicodeEncodeError}
+   Raised when a Unicode-related error occurs during encoding.  It
+   is a subclass of \exception{UnicodeError}.
+ \versionadded{2.3}
+ \end{excdesc}
+ 
+ \begin{excdesc}{UnicodeDecodeError}
+   Raised when a Unicode-related error occurs during decoding.  It
+   is a subclass of \exception{UnicodeError}.
+ \versionadded{2.3}
+ \end{excdesc}
+ 
+ \begin{excdesc}{UnicodeTranslateError}
+   Raised when a Unicode-related error occurs during translating.  It
+   is a subclass of \exception{UnicodeError}.
+ \versionadded{2.3}
+ \end{excdesc}
+ 
  \begin{excdesc}{ValueError}
    Raised when a built-in operation or function receives an argument
***************
*** 427,430 ****
--- 445,451 ----
       |    +-- ValueError
       |    |    +-- UnicodeError
+      |    |        +-- UnicodeEncodeError
+      |    |        +-- UnicodeDecodeError
+      |    |        +-- UnicodeTranslateError
       |    +-- ReferenceError
       |    +-- SystemError