Merge typo fixes from 3.5
diff --git a/Doc/howto/logging-cookbook.rst b/Doc/howto/logging-cookbook.rst
index 57b4333..e784acc 100644
--- a/Doc/howto/logging-cookbook.rst
+++ b/Doc/howto/logging-cookbook.rst
@@ -2231,7 +2231,7 @@
 
 The example script has a simple function, ``foo``, which just cycles through
 all the logging levels, writing to ``sys.stderr`` to say what level it's about
-to log at, and then actually logging a message that that level. You can pass a
+to log at, and then actually logging a message at that level. You can pass a
 parameter to ``foo`` which, if true, will log at ERROR and CRITICAL levels -
 otherwise, it only logs at DEBUG, INFO and WARNING levels.
 
diff --git a/Doc/library/codecs.rst b/Doc/library/codecs.rst
index 49068cb..577a800 100644
--- a/Doc/library/codecs.rst
+++ b/Doc/library/codecs.rst
@@ -977,7 +977,7 @@
 
 * an ISO 8859 codeset
 
-* a Microsoft Windows code page, which is typically derived from a 8859 codeset,
+* a Microsoft Windows code page, which is typically derived from an 8859 codeset,
   but replaces control characters with additional graphic characters
 
 * an IBM EBCDIC code page
diff --git a/Doc/reference/simple_stmts.rst b/Doc/reference/simple_stmts.rst
index 5f60540..79a46e2 100644
--- a/Doc/reference/simple_stmts.rst
+++ b/Doc/reference/simple_stmts.rst
@@ -237,7 +237,7 @@
    phase, causing less detailed error messages.
 
 Although the definition of assignment implies that overlaps between the
-left-hand side and the right-hand side are 'simultanenous' (for example ``a, b =
+left-hand side and the right-hand side are 'simultaneous' (for example ``a, b =
 b, a`` swaps two variables), overlaps *within* the collection of assigned-to
 variables occur left-to-right, sometimes resulting in confusion.  For instance,
 the following program prints ``[0, 2]``::
diff --git a/Include/pythonrun.h b/Include/pythonrun.h
index 3b93a80..cfa0a9f 100644
--- a/Include/pythonrun.h
+++ b/Include/pythonrun.h
@@ -176,7 +176,7 @@
 
 /* Stack size, in "pointers" (so we get extra safety margins
    on 64-bit platforms).  On a 32-bit platform, this translates
-   to a 8k margin. */
+   to an 8k margin. */
 #define PYOS_STACK_MARGIN 2048
 
 #if defined(WIN32) && !defined(MS_WIN64) && defined(_MSC_VER) && _MSC_VER >= 1300
diff --git a/Lib/http/cookiejar.py b/Lib/http/cookiejar.py
index bd367f9..265ccf9 100644
--- a/Lib/http/cookiejar.py
+++ b/Lib/http/cookiejar.py
@@ -1841,7 +1841,7 @@
 class LWPCookieJar(FileCookieJar):
     """
     The LWPCookieJar saves a sequence of "Set-Cookie3" lines.
-    "Set-Cookie3" is the format used by the libwww-perl libary, not known
+    "Set-Cookie3" is the format used by the libwww-perl library, not known
     to be compatible with any browser, but which is easy to read and
     doesn't lose information about RFC 2965 cookies.
 
diff --git a/Lib/idlelib/ChangeLog b/Lib/idlelib/ChangeLog
index 90e02f6..0c36664 100644
--- a/Lib/idlelib/ChangeLog
+++ b/Lib/idlelib/ChangeLog
@@ -1574,7 +1574,7 @@
 	* Attic/PopupMenu.py: Pass a root to the help window.
 
 	* SearchBinding.py:
-	Add parent argument to 'to to line number' dialog box.
+	Add parent argument to 'go to line number' dialog box.
 
 Sat Oct 10 19:15:32 1998  Guido van Rossum  <guido@cnri.reston.va.us>
 
diff --git a/Lib/pickletools.py b/Lib/pickletools.py
index 1c77336..4eefc19 100644
--- a/Lib/pickletools.py
+++ b/Lib/pickletools.py
@@ -590,7 +590,7 @@
               reader=read_bytes8,
               doc="""A counted bytes string.
 
-              The first argument is a 8-byte little-endian unsigned int giving
+              The first argument is an 8-byte little-endian unsigned int giving
               the number of bytes, and the second argument is that many bytes.
               """)
 
@@ -734,7 +734,7 @@
                     reader=read_unicodestring8,
                     doc="""A counted Unicode string.
 
-                    The first argument is a 8-byte little-endian signed int
+                    The first argument is an 8-byte little-endian signed int
                     giving the number of bytes in the string, and the second
                     argument-- the UTF-8 encoding of the Unicode string --
                     contains that many bytes.
@@ -1330,7 +1330,7 @@
       proto=4,
       doc="""Push a Python bytes object.
 
-      There are two arguments:  the first is a 8-byte unsigned int giving
+      There are two arguments:  the first is an 8-byte unsigned int giving
       the number of bytes in the string, and the second is that many bytes,
       which are taken literally as the string content.
       """),
@@ -1417,7 +1417,7 @@
       proto=4,
       doc="""Push a Python Unicode string object.
 
-      There are two arguments:  the first is a 8-byte little-endian signed int
+      There are two arguments:  the first is an 8-byte little-endian signed int
       giving the number of bytes in the string.  The second is that many
       bytes, and is the UTF-8 encoding of the Unicode string.
       """),
diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py
index d1b2905..9aedba2 100644
--- a/Lib/test/test_descr.py
+++ b/Lib/test/test_descr.py
@@ -3489,7 +3489,7 @@
         b.a = a
         z = deepcopy(a) # This blew up before
 
-    def test_unintialized_modules(self):
+    def test_uninitialized_modules(self):
         # Testing uninitialized module objects...
         from types import ModuleType as M
         m = M.__new__(M)
diff --git a/Lib/test/test_module.py b/Lib/test/test_module.py
index 48ab0b4..3a076b3 100644
--- a/Lib/test/test_module.py
+++ b/Lib/test/test_module.py
@@ -30,7 +30,7 @@
             pass
         self.assertEqual(foo.__doc__, ModuleType.__doc__)
 
-    def test_unintialized_missing_getattr(self):
+    def test_uninitialized_missing_getattr(self):
         # Issue 8297
         # test the text in the AttributeError of an uninitialized module
         foo = ModuleType.__new__(ModuleType)
diff --git a/Lib/tkinter/__init__.py b/Lib/tkinter/__init__.py
index 3f242ac..7fbe147 100644
--- a/Lib/tkinter/__init__.py
+++ b/Lib/tkinter/__init__.py
@@ -1248,7 +1248,7 @@
         nsign, b, f, h, k, s, t, w, x, y, A, E, K, N, W, T, X, Y, D = args
         # Missing: (a, c, d, m, o, v, B, R)
         e = Event()
-        # serial field: valid vor all events
+        # serial field: valid for all events
         # number of button: ButtonPress and ButtonRelease events only
         # height field: Configure, ConfigureRequest, Create,
         # ResizeRequest, and Expose events only
@@ -1256,11 +1256,11 @@
         # time field: "valid for events that contain a time field"
         # width field: Configure, ConfigureRequest, Create, ResizeRequest,
         # and Expose events only
-        # x field: "valid for events that contain a x field"
+        # x field: "valid for events that contain an x field"
         # y field: "valid for events that contain a y field"
         # keysym as decimal: KeyPress and KeyRelease events only
         # x_root, y_root fields: ButtonPress, ButtonRelease, KeyPress,
-        # KeyRelease,and Motion events
+        # KeyRelease, and Motion events
         e.serial = getint(nsign)
         e.num = getint_event(b)
         try: e.focus = getboolean(f)
diff --git a/Lib/urllib/robotparser.py b/Lib/urllib/robotparser.py
index 4ac553a..85add16 100644
--- a/Lib/urllib/robotparser.py
+++ b/Lib/urllib/robotparser.py
@@ -153,7 +153,7 @@
             return True
         # Until the robots.txt file has been read or found not
         # to exist, we must assume that no url is allowable.
-        # This prevents false positives when a user erronenously
+        # This prevents false positives when a user erroneously
         # calls can_fetch() before calling read().
         if not self.last_checked:
             return False
diff --git a/Mac/BuildScript/scripts/postflight.patch-profile b/Mac/BuildScript/scripts/postflight.patch-profile
index 36d0a3e..0a62e32 100755
--- a/Mac/BuildScript/scripts/postflight.patch-profile
+++ b/Mac/BuildScript/scripts/postflight.patch-profile
@@ -58,7 +58,7 @@
 	fi
 	echo "" >> "${RC}"
 	echo "# Setting PATH for Python ${PYVER}" >> "${RC}"
-	echo "# The orginal version is saved in .cshrc.pysave" >> "${RC}"
+	echo "# The original version is saved in .cshrc.pysave" >> "${RC}"
 	echo "set path=(${PYTHON_ROOT}/bin "'$path'")" >> "${RC}"
 	if [ `id -ur` = 0 ]; then
 		chown "${USER}" "${RC}"
@@ -90,7 +90,7 @@
 fi
 echo "" >> "${PR}"
 echo "# Setting PATH for Python ${PYVER}" >> "${PR}"
-echo "# The orginal version is saved in `basename ${PR}`.pysave" >> "${PR}"
+echo "# The original version is saved in `basename ${PR}`.pysave" >> "${PR}"
 echo 'PATH="'"${PYTHON_ROOT}/bin"':${PATH}"' >> "${PR}"
 echo 'export PATH' >> "${PR}"
 if [ `id -ur` = 0 ]; then
diff --git a/Mac/README b/Mac/README
index 6e08fdc..b4c6b7f 100644
--- a/Mac/README
+++ b/Mac/README
@@ -126,7 +126,7 @@
 
 To build a universal binary that includes a 64-bit architecture, you must build
 on a system running OS X 10.5 or later.  The ``all`` and ``64-bit`` flavors can
-only be built with an 10.5 SDK because ``ppc64`` support was only included with
+only be built with a 10.5 SDK because ``ppc64`` support was only included with
 OS X 10.5.  Although legacy ``ppc`` support was included with Xcode 3 on OS X
 10.6, it was removed in Xcode 4, versions of which were released on OS X 10.6
 and which is the standard for OS X 10.7.  To summarize, the
diff --git a/Misc/NEWS b/Misc/NEWS
index 705603b..cc44ba7 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -3308,7 +3308,7 @@
   is run with pythonw.exe.
 
 - Issue #21775: shutil.copytree(): fix crash when copying to VFAT. An exception
-  handler assumed that that OSError objects always have a 'winerror' attribute.
+  handler assumed that OSError objects always have a 'winerror' attribute.
   That is not the case, so the exception handler itself raised AttributeError
   when run on Linux (and, presumably, any other non-Windows OS).
   Patch by Greg Ward.
diff --git a/Modules/arraymodule.c b/Modules/arraymodule.c
index 323e0c1..78e5561 100644
--- a/Modules/arraymodule.c
+++ b/Modules/arraymodule.c
@@ -2090,7 +2090,7 @@
          * that fits better. This may result in an array with narrower
          * or wider elements.
          *
-         * For example, if a 32-bit machine pickles a L-code array of
+         * For example, if a 32-bit machine pickles an L-code array of
          * unsigned longs, then the array will be unpickled by 64-bit
          * machine as an I-code array of unsigned ints.
          *
diff --git a/Modules/audioop.c b/Modules/audioop.c
index d97a369..9a96eea 100644
--- a/Modules/audioop.c
+++ b/Modules/audioop.c
@@ -46,7 +46,7 @@
  */
 #define BIAS 0x84   /* define the add-in bias for 16 bit samples */
 #define CLIP 32635
-#define SIGN_BIT        (0x80)          /* Sign bit for a A-law byte. */
+#define SIGN_BIT        (0x80)          /* Sign bit for an A-law byte. */
 #define QUANT_MASK      (0xf)           /* Quantization field mask. */
 #define SEG_SHIFT       (4)             /* Left shift for segment number. */
 #define SEG_MASK        (0x70)          /* Segment field mask. */
@@ -219,7 +219,7 @@
 };
 
 /*
- * linear2alaw() accepts an 13-bit signed integer and encodes it as A-law data
+ * linear2alaw() accepts a 13-bit signed integer and encodes it as A-law data
  * stored in an unsigned char.  This function should only be called with
  * the data shifted such that it only contains information in the lower
  * 13-bits.
diff --git a/PC/pyconfig.h b/PC/pyconfig.h
index 8861148..1463ee6 100644
--- a/PC/pyconfig.h
+++ b/PC/pyconfig.h
@@ -347,7 +347,7 @@
 #	define SIZEOF_FPOS_T 8
 #	define SIZEOF_HKEY 4
 #	define SIZEOF_SIZE_T 4
-	/* MS VS2005 changes time_t to an 64-bit type on all platforms */
+	/* MS VS2005 changes time_t to a 64-bit type on all platforms */
 #	if defined(_MSC_VER) && _MSC_VER >= 1400
 #	define SIZEOF_TIME_T 8
 #	else
diff --git a/Python/formatter_unicode.c b/Python/formatter_unicode.c
index a428fbe..d573288 100644
--- a/Python/formatter_unicode.c
+++ b/Python/formatter_unicode.c
@@ -1042,7 +1042,7 @@
     else if (type == 'r')
         type = 'g';
 
-    /* Cast "type", because if we're in unicode we need to pass a
+    /* Cast "type", because if we're in unicode we need to pass an
        8-bit char. This is safe, because we've restricted what "type"
        can be. */
     buf = PyOS_double_to_string(val, (char)type, precision, flags,
@@ -1221,7 +1221,7 @@
     else if (type == 'r')
         type = 'g';
 
-    /* Cast "type", because if we're in unicode we need to pass a
+    /* Cast "type", because if we're in unicode we need to pass an
        8-bit char. This is safe, because we've restricted what "type"
        can be. */
     re_buf = PyOS_double_to_string(re, (char)type, precision, flags,