Fix a bunch of typos in documentation, docstrings and comments.
(From SF patch #810751)
diff --git a/Doc/lib/libprofile.tex b/Doc/lib/libprofile.tex
index f36ebfa..4d62094 100644
--- a/Doc/lib/libprofile.tex
+++ b/Doc/lib/libprofile.tex
@@ -407,7 +407,7 @@
 \code{'name'}).
 
 When more than one key is provided, then additional keys are used as
-secondary criteria when the there is equality in all keys selected
+secondary criteria when there is equality in all keys selected
 before them.  For example, \samp{sort_stats('name', 'file')} will sort
 all the entries according to their function name, and resolve all ties
 (identical function names) by sorting by file name.
diff --git a/Doc/lib/libregex.tex b/Doc/lib/libregex.tex
index bd86db5..93c389a 100644
--- a/Doc/lib/libregex.tex
+++ b/Doc/lib/libregex.tex
@@ -247,7 +247,7 @@
   \code{match()} and \code{search()}.  (Already compiled expression
   objects are not affected.)  The argument is an integer which is the
   OR of several flag bits.  The return value is the previous value of
-  the syntax flags.  Names for the flags are defined in the standard 
+  the syntax flags.  Names for the flags are defined in the standard
   module \code{regex_syntax}\refstmodindex{regex_syntax}; read the
   file \file{regex_syntax.py} for more information.
 \end{funcdesc}