[Python-checkins] r43118 - python/trunk/Doc/lib/compiler.tex python/trunk/Doc/lib/libarray.tex python/trunk/Doc/lib/libcgi.tex python/trunk/Doc/lib/libcodecs.tex python/trunk/Doc/lib/libcookielib.tex python/trunk/Doc/lib/libitertools.tex python/trunk/Doc/lib/libnntplib.tex python/trunk/Doc/lib/liboptparse.tex python/trunk/Doc/lib/libossaudiodev.tex python/trunk/Doc/lib/libpycompile.tex python/trunk/Doc/lib/libre.tex python/trunk/Doc/lib/libsets.tex python/trunk/Doc/lib/libshutil.tex python/trunk/Doc/lib/libstdtypes.tex python/trunk/Doc/lib/libsubprocess.tex python/trunk/Doc/lib/liburllib2.tex python/trunk/Doc/lib/libzipimport.tex python/trunk/Doc/lib/xmldomminidom.tex

georg.brandl python-checkins at python.org
Fri Mar 17 17:26:40 CET 2006


Author: georg.brandl
Date: Fri Mar 17 17:26:31 2006
New Revision: 43118

Modified:
   python/trunk/Doc/lib/compiler.tex
   python/trunk/Doc/lib/libarray.tex
   python/trunk/Doc/lib/libcgi.tex
   python/trunk/Doc/lib/libcodecs.tex
   python/trunk/Doc/lib/libcookielib.tex
   python/trunk/Doc/lib/libitertools.tex
   python/trunk/Doc/lib/libnntplib.tex
   python/trunk/Doc/lib/liboptparse.tex
   python/trunk/Doc/lib/libossaudiodev.tex
   python/trunk/Doc/lib/libpycompile.tex
   python/trunk/Doc/lib/libre.tex
   python/trunk/Doc/lib/libsets.tex
   python/trunk/Doc/lib/libshutil.tex
   python/trunk/Doc/lib/libstdtypes.tex
   python/trunk/Doc/lib/libsubprocess.tex
   python/trunk/Doc/lib/liburllib2.tex
   python/trunk/Doc/lib/libzipimport.tex
   python/trunk/Doc/lib/xmldomminidom.tex
Log:
More \exception fixes.



Modified: python/trunk/Doc/lib/compiler.tex
==============================================================================
--- python/trunk/Doc/lib/compiler.tex	(original)
+++ python/trunk/Doc/lib/compiler.tex	Fri Mar 17 17:26:31 2006
@@ -40,9 +40,9 @@
 
 \begin{funcdesc}{parse}{buf}
 Returns an abstract syntax tree for the Python source code in \var{buf}.
-The function raises SyntaxError if there is an error in the source
-code.  The return value is a \class{compiler.ast.Module} instance that
-contains the tree.  
+The function raises \exception{SyntaxError} if there is an error in the
+source code.  The return value is a \class{compiler.ast.Module} instance
+that contains the tree.  
 \end{funcdesc}
 
 \begin{funcdesc}{parseFile}{path}

Modified: python/trunk/Doc/lib/libarray.tex
==============================================================================
--- python/trunk/Doc/lib/libarray.tex	(original)
+++ python/trunk/Doc/lib/libarray.tex	Fri Mar 17 17:26:31 2006
@@ -139,8 +139,8 @@
 \end{methoddesc}
 
 \begin{methoddesc}[array]{fromunicode}{s}
-Extends this array with data from the given unicode string.
-The array must be a type 'u' array; otherwise a ValueError
+Extends this array with data from the given unicode string.  The array
+must be a type \code{'u'} array; otherwise a \exception{ValueError}
 is raised.  Use \samp{array.fromstring(ustr.decode(enc))} to
 append Unicode data to an array of some other type.
 \end{methoddesc}
@@ -197,8 +197,8 @@
 
 \begin{methoddesc}[array]{tounicode}{}
 Convert the array to a unicode string.  The array must be
-a type 'u' array; otherwise a ValueError is raised.  Use
-array.tostring().decode(enc) to obtain a unicode string
+a type \code{'u'} array; otherwise a \exception{ValueError} is raised.
+Use \samp{array.tostring().decode(enc)} to obtain a unicode string
 from an array of some other type.
 \end{methoddesc}
 

Modified: python/trunk/Doc/lib/libcgi.tex
==============================================================================
--- python/trunk/Doc/lib/libcgi.tex	(original)
+++ python/trunk/Doc/lib/libcgi.tex	Fri Mar 17 17:26:31 2006
@@ -323,7 +323,7 @@
 
 The optional argument \var{strict_parsing} is a flag indicating what
 to do with parsing errors.  If false (the default), errors
-are silently ignored.  If true, errors raise a ValueError
+are silently ignored.  If true, errors raise a \exception{ValueError}
 exception.
 
 Use the \function{\refmodule{urllib}.urlencode()} function to convert
@@ -347,7 +347,7 @@
 
 The optional argument \var{strict_parsing} is a flag indicating what
 to do with parsing errors.  If false (the default), errors
-are silently ignored.  If true, errors raise a ValueError
+are silently ignored.  If true, errors raise a \exception{ValueError}
 exception.
 
 Use the \function{\refmodule{urllib}.urlencode()} function to convert

Modified: python/trunk/Doc/lib/libcodecs.tex
==============================================================================
--- python/trunk/Doc/lib/libcodecs.tex	(original)
+++ python/trunk/Doc/lib/libcodecs.tex	Fri Mar 17 17:26:31 2006
@@ -152,7 +152,7 @@
 continue. The encoder will encode the replacement and continue encoding
 the original input at the specified position. Negative position values
 will be treated as being relative to the end of the input string. If the
-resulting position is out of bound an IndexError will be raised.
+resulting position is out of bound an \exception{IndexError} will be raised.
 
 Decoding and translating works similar, except \exception{UnicodeDecodeError}
 or \exception{UnicodeTranslateError} will be passed to the handler and
@@ -696,10 +696,10 @@
 The simplest method is to map the codepoints 0-255 to the bytes
 \code{0x0}-\code{0xff}. This means that a unicode object that contains 
 codepoints above \code{U+00FF} can't be encoded with this method (which 
-is called \code{'latin-1'} or \code{'iso-8859-1'}). unicode.encode() will 
-raise a UnicodeEncodeError that looks like this: \samp{UnicodeEncodeError:
-'latin-1' codec can't encode character u'\e u1234' in position 3: ordinal
-not in range(256)}.
+is called \code{'latin-1'} or \code{'iso-8859-1'}).
+\function{unicode.encode()} will raise a \exception{UnicodeEncodeError}
+that looks like this: \samp{UnicodeEncodeError: 'latin-1' codec can't
+encode character u'\e u1234' in position 3: ordinal not in range(256)}.
 
 There's another group of encodings (the so called charmap encodings)
 that choose a different subset of all unicode code points and how

Modified: python/trunk/Doc/lib/libcookielib.tex
==============================================================================
--- python/trunk/Doc/lib/libcookielib.tex	(original)
+++ python/trunk/Doc/lib/libcookielib.tex	Fri Mar 17 17:26:31 2006
@@ -249,7 +249,7 @@
     ignore_discard=\constant{False}, ignore_expires=\constant{False}}
 Save cookies to a file.
 
-This base class raises \class{NotImplementedError}.  Subclasses may
+This base class raises \exception{NotImplementedError}.  Subclasses may
 leave this method unimplemented.
 
 \var{filename} is the name of file in which to save cookies.  If

Modified: python/trunk/Doc/lib/libitertools.tex
==============================================================================
--- python/trunk/Doc/lib/libitertools.tex	(original)
+++ python/trunk/Doc/lib/libitertools.tex	Fri Mar 17 17:26:31 2006
@@ -281,7 +281,8 @@
   \end{verbatim}
 
   \versionchanged[When no iterables are specified, returns a zero length
-                  iterator instead of raising a TypeError exception]{2.4}  
+                  iterator instead of raising a \exception{TypeError}
+		  exception]{2.4}
 \end{funcdesc}
 
 \begin{funcdesc}{repeat}{object\optional{, times}}

Modified: python/trunk/Doc/lib/libnntplib.tex
==============================================================================
--- python/trunk/Doc/lib/libnntplib.tex	(original)
+++ python/trunk/Doc/lib/libnntplib.tex	Fri Mar 17 17:26:31 2006
@@ -68,48 +68,48 @@
 sent before authentication is performed.  Reader mode is sometimes
 necessary if you are connecting to an NNTP server on the local machine
 and intend to call reader-specific commands, such as \samp{group}.  If
-you get unexpected \code{NNTPPermanentError}s, you might need to set
+you get unexpected \exception{NNTPPermanentError}s, you might need to set
 \var{readermode}.  \var{readermode} defaults to \code{None}.
 \var{usenetrc} defaults to \code{True}.
 
 \versionchanged[\var{usenetrc} argument added]{2.4}
 \end{classdesc}
 
-\begin{classdesc}{NNTPError}{}
-Derived from the standard exception \code{Exception}, this is the base
-class for all exceptions raised by the \code{nntplib} module.
-\end{classdesc}
+\begin{excdesc}{NNTPError}
+Derived from the standard exception \exception{Exception}, this is the
+base class for all exceptions raised by the \module{nntplib} module.
+\end{excdesc}
 
-\begin{classdesc}{NNTPReplyError}{}
+\begin{excdesc}{NNTPReplyError}
 Exception raised when an unexpected reply is received from the
 server.  For backwards compatibility, the exception \code{error_reply}
 is equivalent to this class.
-\end{classdesc}
+\end{excdesc}
 
-\begin{classdesc}{NNTPTemporaryError}{}
+\begin{excdesc}{NNTPTemporaryError}
 Exception raised when an error code in the range 400--499 is
 received.  For backwards compatibility, the exception
 \code{error_temp} is equivalent to this class.
-\end{classdesc}
+\end{excdesc}
 
-\begin{classdesc}{NNTPPermanentError}{}
+\begin{excdesc}{NNTPPermanentError}
 Exception raised when an error code in the range 500--599 is
 received.  For backwards compatibility, the exception
 \code{error_perm} is equivalent to this class.
-\end{classdesc}
+\end{excdesc}
 
-\begin{classdesc}{NNTPProtocolError}{}
+\begin{excdesc}{NNTPProtocolError}
 Exception raised when a reply is received from the server that does
 not begin with a digit in the range 1--5.  For backwards
 compatibility, the exception \code{error_proto} is equivalent to this
 class.
-\end{classdesc}
+\end{excdesc}
 
-\begin{classdesc}{NNTPDataError}{}
+\begin{excdesc}{NNTPDataError}
 Exception raised when there is some error in the response data.  For
 backwards compatibility, the exception \code{error_data} is
 equivalent to this class.
-\end{classdesc}
+\end{excdesc}
 
 
 \subsection{NNTP Objects \label{nntp-objects}}

Modified: python/trunk/Doc/lib/liboptparse.tex
==============================================================================
--- python/trunk/Doc/lib/liboptparse.tex	(original)
+++ python/trunk/Doc/lib/liboptparse.tex	Fri Mar 17 17:26:31 2006
@@ -100,8 +100,8 @@
 single letter, e.g. \code{"-x"} or \code{"-F"}.  Also, traditional \UNIX{}
 syntax allows multiple options to be merged into a single argument,
 e.g.  \code{"-x -F"} is equivalent to \code{"-xF"}.  The GNU project
-introduced \code{"-{}-"} followed by a series of hyphen-separated words,
-e.g. \code{"-{}-file"} or \code{"-{}-dry-run"}.  These are the only two option
+introduced \code{"{--}"} followed by a series of hyphen-separated words,
+e.g. \code{"{--}file"} or \code{"{--}dry-run"}.  These are the only two option
 syntaxes provided by \module{optparse}.
 
 Some other option syntaxes that the world has seen include:
@@ -170,7 +170,7 @@
 prog -v --report /tmp/report.txt foo bar
 \end{verbatim}
 
-\code{"-v"} and \code{"-{}-report"} are both options.  Assuming that
+\code{"-v"} and \code{"{--}report"} are both options.  Assuming that
 \longprogramopt{report} takes one argument, \code{"/tmp/report.txt"} is an option
 argument.  \code{"foo"} and \code{"bar"} are positional arguments.
 
@@ -587,7 +587,7 @@
 erroneous calls to \code{parse.add{\_}option()}, e.g. invalid option strings,
 unknown option attributes, missing option attributes, etc.  These are
 dealt with in the usual way: raise an exception (either
-\code{optparse.OptionError} or \code{TypeError}) and let the program crash.
+\exception{optparse.OptionError} or \exception{TypeError}) and let the program crash.
 
 Handling user errors is much more important, since they are guaranteed
 to happen no matter how stable your code is.  \module{optparse} can automatically
@@ -1019,9 +1019,9 @@
 
 Integer arguments are passed to \code{int()} to convert them to Python
 integers.  If \code{int()} fails, so will \module{optparse}, although with a more
-useful error message.  (Internally, \module{optparse} raises OptionValueError;
-OptionParser catches this exception higher up and terminates your
-program with a useful error message.)
+useful error message.  (Internally, \module{optparse} raises
+\exception{OptionValueError}; OptionParser catches this exception higher
+up and terminates your program with a useful error message.)
 
 Likewise, \code{float} arguments are passed to \code{float()} for conversion,
 \code{long} arguments to \code{long()}, and \code{complex} arguments to
@@ -1032,7 +1032,7 @@
 option attribute (a sequence of strings) defines the set of allowed
 option arguments.  \code{optparse.option.check{\_}choice()} compares
 user-supplied option arguments against this master list and raises
-OptionValueError if an invalid string is given.
+\exception{OptionValueError} if an invalid string is given.
 
 
 \subsubsection{Querying and manipulating your option parser\label{optparse-querying-manipulating-option-parser}}
@@ -1052,7 +1052,7 @@
 option strings, all of those option strings become invalid.
 
 If \code{opt{\_}str} does not occur in any option belonging to this
-OptionParser, raises ValueError.
+OptionParser, raises \exception{ValueError}.
 \end{description}
 
 
@@ -1087,7 +1087,7 @@
 \begin{description}
 \item[\code{error} (default)]
 assume option conflicts are a programming error and raise 
-OptionConflictError
+\exception{OptionConflictError}
 \item[\code{resolve}]
 resolve option conflicts intelligently (see below)
 \end{description}
@@ -1260,7 +1260,7 @@
 
 \subsubsection{Raising errors in a callback\label{optparse-raising-errors-in-callback}}
 
-The callback function should raise OptionValueError if there are any
+The callback function should raise \exception{OptionValueError} if there are any
 problems with the option or its argument(s).  \module{optparse} catches this and
 terminates the program, printing the error message you supply to
 stderr.  Your message should be clear, concise, accurate, and mention

Modified: python/trunk/Doc/lib/libossaudiodev.tex
==============================================================================
--- python/trunk/Doc/lib/libossaudiodev.tex	(original)
+++ python/trunk/Doc/lib/libossaudiodev.tex	Fri Mar 17 17:26:31 2006
@@ -311,7 +311,7 @@
 
 \begin{methoddesc}[mixer device]{close}{}
 This method closes the open mixer device file.  Any further attempts to
-use the mixer after this file is closed will raise an IOError.
+use the mixer after this file is closed will raise an \exception{IOError}.
 \end{methoddesc}
 
 \begin{methoddesc}[mixer device]{fileno}{}

Modified: python/trunk/Doc/lib/libpycompile.tex
==============================================================================
--- python/trunk/Doc/lib/libpycompile.tex	(original)
+++ python/trunk/Doc/lib/libpycompile.tex	Fri Mar 17 17:26:31 2006
@@ -30,9 +30,10 @@
   \code{+} \code{'c'} (\code{'o'} if optimization is enabled in the
   current interpreter).  If \var{dfile} is specified, it is used as
   the name of the source file in error messages instead of \var{file}. 
-  If \var{doraise} = True, a PyCompileError is raised when an error is 
-  encountered while compiling \var{file}. If \var{doraise} = False (the default), 
-  an error string is written to sys.stderr, but no exception is raised.
+  If \var{doraise} is true, a \exception{PyCompileError} is raised when
+  an error is encountered while compiling \var{file}. If \var{doraise}
+  is false (the default), an error string is written to \code{sys.stderr},
+  but no exception is raised.
 \end{funcdesc}
 
 \begin{funcdesc}{main}{\optional{args}}

Modified: python/trunk/Doc/lib/libre.tex
==============================================================================
--- python/trunk/Doc/lib/libre.tex	(original)
+++ python/trunk/Doc/lib/libre.tex	Fri Mar 17 17:26:31 2006
@@ -931,7 +931,7 @@
 \leftline{\strong{Avoiding recursion}}
 
 If you create regular expressions that require the engine to perform a
-lot of recursion, you may encounter a RuntimeError exception with
+lot of recursion, you may encounter a \exception{RuntimeError} exception with
 the message \code{maximum recursion limit} exceeded. For example,
 
 \begin{verbatim}

Modified: python/trunk/Doc/lib/libsets.tex
==============================================================================
--- python/trunk/Doc/lib/libsets.tex	(original)
+++ python/trunk/Doc/lib/libsets.tex	Fri Mar 17 17:26:31 2006
@@ -151,12 +151,13 @@
   \lineiii{\var{s}.add(\var{x})}{}
          {add element \var{x} to set \var{s}}
   \lineiii{\var{s}.remove(\var{x})}{}
-         {remove \var{x} from set \var{s}; raises KeyError if not present}
+         {remove \var{x} from set \var{s}; raises \exception{KeyError}
+	  if not present}
   \lineiii{\var{s}.discard(\var{x})}{}
          {removes \var{x} from set \var{s} if present}
   \lineiii{\var{s}.pop()}{}
          {remove and return an arbitrary element from \var{s}; raises
-	  KeyError if empty}
+	  \exception{KeyError} if empty}
   \lineiii{\var{s}.clear()}{}
          {remove all elements from set \var{s}}
 \end{tableiii}

Modified: python/trunk/Doc/lib/libshutil.tex
==============================================================================
--- python/trunk/Doc/lib/libshutil.tex	(original)
+++ python/trunk/Doc/lib/libshutil.tex	Fri Mar 17 17:26:31 2006
@@ -73,18 +73,18 @@
   If \var{symlinks} is true, symbolic links in
   the source tree are represented as symbolic links in the new tree;
   if false or omitted, the contents of the linked files are copied to
-  the new tree.  If exception(s) occur, an Error is raised
+  the new tree.  If exception(s) occur, an \exception{Error} is raised
   with a list of reasons.
 
   The source code for this should be considered an example rather than 
   a tool.
 
-  \versionchanged[Error is raised if any exceptions occur during copying,
-  rather than printing a message]{2.3}
+  \versionchanged[\exception{Error} is raised if any exceptions occur during
+                  copying, rather than printing a message]{2.3}
 
   \versionchanged[Create intermediate directories needed to create \var{dst},
-  rather than raising an error. Copy permissions and times of directories using
-  \function{copystat()}]{2.5}
+                  rather than raising an error. Copy permissions and times of
+		  directories using \function{copystat()}]{2.5}
 
 \end{funcdesc}
 

Modified: python/trunk/Doc/lib/libstdtypes.tex
==============================================================================
--- python/trunk/Doc/lib/libstdtypes.tex	(original)
+++ python/trunk/Doc/lib/libstdtypes.tex	Fri Mar 17 17:26:31 2006
@@ -1278,7 +1278,8 @@
   \lineiii{\var{s}.add(\var{x})}{}
          {add element \var{x} to set \var{s}}
   \lineiii{\var{s}.remove(\var{x})}{}
-         {remove \var{x} from set \var{s}; raises KeyError if not present}
+         {remove \var{x} from set \var{s}; raises \exception{KeyError}
+	  if not present}
   \lineiii{\var{s}.discard(\var{x})}{}
          {removes \var{x} from set \var{s} if present}
   \lineiii{\var{s}.pop()}{}
@@ -1789,14 +1790,14 @@
 attribute will be \code{None} and if called, an explicit \code{self}
 object must be passed as the first argument.  In this case,
 \code{self} must be an instance of the unbound method's class (or a
-subclass of that class), otherwise a \code{TypeError} is raised.
+subclass of that class), otherwise a \exception{TypeError} is raised.
 
 Like function objects, methods objects support getting
 arbitrary attributes.  However, since method attributes are actually
 stored on the underlying function object (\code{meth.im_func}),
 setting method attributes on either bound or unbound methods is
 disallowed.  Attempting to set a method attribute results in a
-\code{TypeError} being raised.  In order to set a method attribute,
+\exception{TypeError} being raised.  In order to set a method attribute,
 you need to explicitly set it on the underlying function object:
 
 \begin{verbatim}

Modified: python/trunk/Doc/lib/libsubprocess.tex
==============================================================================
--- python/trunk/Doc/lib/libsubprocess.tex	(original)
+++ python/trunk/Doc/lib/libsubprocess.tex	Fri Mar 17 17:26:31 2006
@@ -135,8 +135,8 @@
 
 \begin{funcdesc}{check_call}{*popenargs, **kwargs}
 Run command with arguments.  Wait for command to complete. If the exit
-code was zero then return, otherwise raise CalledProcessError.  The
-CalledProcessError object will have the return code in the
+code was zero then return, otherwise raise \exception{CalledProcessError.}
+The \exception{CalledProcessError} object will have the return code in the
 \member{errno} attribute.
 
 The arguments are the same as for the Popen constructor.  Example:

Modified: python/trunk/Doc/lib/liburllib2.tex
==============================================================================
--- python/trunk/Doc/lib/liburllib2.tex	(original)
+++ python/trunk/Doc/lib/liburllib2.tex	Fri Mar 17 17:26:31 2006
@@ -384,7 +384,7 @@
     \method{\var{protocol}_open()} are called to handle the request.
     This stage ends when a handler either returns a
     non-\constant{None} value (ie. a response), or raises an exception
-    (usually URLError).  Exceptions are allowed to propagate.
+    (usually \exception{URLError}).  Exceptions are allowed to propagate.
 
     In fact, the above algorithm is first tried for methods named
     \method{default_open}.  If all such methods return

Modified: python/trunk/Doc/lib/libzipimport.tex
==============================================================================
--- python/trunk/Doc/lib/libzipimport.tex	(original)
+++ python/trunk/Doc/lib/libzipimport.tex	Fri Mar 17 17:26:31 2006
@@ -69,8 +69,8 @@
 
 \begin{classdesc}{zipimporter}{archivepath} 
   Create a new zipimporter instance. \var{archivepath} must be a path to
-  a zipfile.  \class{ZipImportError} is raised if \var{archivepath} doesn't
-  point to a valid ZIP archive.
+  a zipfile.  \exception{ZipImportError} is raised if \var{archivepath}
+  doesn't point to a valid ZIP archive.
 \end{classdesc}
 
 \begin{methoddesc}{find_module}{fullname\optional{, path}}
@@ -83,7 +83,7 @@
 
 \begin{methoddesc}{get_code}{fullname}
   Return the code object for the specified module. Raise
-  \class{ZipImportError} if the module couldn't be found.
+  \exception{ZipImportError} if the module couldn't be found.
 \end{methoddesc}
 
 \begin{methoddesc}{get_data}{pathname}
@@ -93,20 +93,20 @@
 
 \begin{methoddesc}{get_source}{fullname}
   Return the source code for the specified module. Raise
-  \class{ZipImportError} if the module couldn't be found, return
+  \exception{ZipImportError} if the module couldn't be found, return
   \constant{None} if the archive does contain the module, but has
   no source for it.
 \end{methoddesc}
 
 \begin{methoddesc}{is_package}{fullname}
   Return True if the module specified by \var{fullname} is a package.
-  Raise \class{ZipImportError} if the module couldn't be found.
+  Raise \exception{ZipImportError} if the module couldn't be found.
 \end{methoddesc}
 
 \begin{methoddesc}{load_module}{fullname}
   Load the module specified by \var{fullname}. \var{fullname} must be the
   fully qualified (dotted) module name. It returns the imported
-  module, or raises \class{ZipImportError} if it wasn't found.
+  module, or raises \exception{ZipImportError} if it wasn't found.
 \end{methoddesc}
 
 \subsection{Examples}

Modified: python/trunk/Doc/lib/xmldomminidom.tex
==============================================================================
--- python/trunk/Doc/lib/xmldomminidom.tex	(original)
+++ python/trunk/Doc/lib/xmldomminidom.tex	Fri Mar 17 17:26:31 2006
@@ -165,7 +165,7 @@
 
 With an explicit \var{encoding} argument, the result is a byte string
 in the specified encoding. It is recommended that this argument is
-always specified. To avoid UnicodeError exceptions in case of
+always specified. To avoid \exception{UnicodeError} exceptions in case of
 unrepresentable text data, the encoding argument should be specified
 as "utf-8".
 


More information about the Python-checkins mailing list