From 9955a373a8ae5a3ac9108afc436199277fdedff7 Mon Sep 17 00:00:00 2001 From: Martin Panter Date: Wed, 7 Oct 2015 10:26:23 +0000 Subject: [PATCH 1/2] Various minor typos in documentation and comments --- Doc/library/collections.rst | 2 +- Doc/library/test.rst | 2 +- Lib/http/server.py | 2 +- Misc/HISTORY | 2 +- Misc/NEWS | 2 +- Modules/_io/stringio.c | 2 +- Objects/object.c | 2 +- Objects/typeobject.c | 2 +- PC/VS9.0/kill_python.c | 2 +- PCbuild/kill_python.c | 2 +- Python/ceval.c | 4 ++-- 11 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Doc/library/collections.rst b/Doc/library/collections.rst index 347cf1fca5c..09718254eb7 100644 --- a/Doc/library/collections.rst +++ b/Doc/library/collections.rst @@ -980,7 +980,7 @@ anywhere a regular dictionary is used. The :class:`OrderedDict` constructor and :meth:`update` method both accept keyword arguments, but their order is lost because Python's function call -semantics pass-in keyword arguments using a regular unordered dictionary. +semantics pass in keyword arguments using a regular unordered dictionary. :class:`OrderedDict` Examples and Recipes diff --git a/Doc/library/test.rst b/Doc/library/test.rst index 974909e1820..2fdaf8cb371 100644 --- a/Doc/library/test.rst +++ b/Doc/library/test.rst @@ -160,7 +160,7 @@ Running tests using the command-line interface The :mod:`test` package can be run as a script to drive Python's regression test suite, thanks to the :option:`-m` option: :program:`python -m test`. Under the hood, it uses :mod:`test.regrtest`; the call :program:`python -m -test.regrtest` used in previous Python versions still works). Running the +test.regrtest` used in previous Python versions still works. Running the script by itself automatically starts running all regression tests in the :mod:`test` package. It does this by finding all modules in the package whose name starts with ``test_``, importing them, and executing the function diff --git a/Lib/http/server.py b/Lib/http/server.py index a97aa312dc9..4688096b31c 100644 --- a/Lib/http/server.py +++ b/Lib/http/server.py @@ -881,7 +881,7 @@ class SimpleHTTPRequestHandler(BaseHTTPRequestHandler): def _url_collapse_path(path): """ Given a URL path, remove extra '/'s and '.' path elements and collapse - any '..' references and returns a colllapsed path. + any '..' references and returns a collapsed path. Implements something akin to RFC-2396 5.2 step 6 to parse relative paths. The utility of this function is limited to is_cgi method and helps diff --git a/Misc/HISTORY b/Misc/HISTORY index f48375931ab..595795682d2 100644 --- a/Misc/HISTORY +++ b/Misc/HISTORY @@ -6718,7 +6718,7 @@ Library - Issue #7895: platform.mac_ver() no longer crashes after calling os.fork(). -- Issue #9323: Fixed a bug in trace.py that resulted in loosing the name of the +- Issue #9323: Fixed a bug in trace.py that resulted in losing the name of the script being traced. Patch by Eli Bendersky. - Issue #9282: Fixed --listfuncs option of trace.py. Thanks Eli Bendersky for diff --git a/Misc/NEWS b/Misc/NEWS index f393d68544a..ba7e54d21f1 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -1131,7 +1131,7 @@ Core and Builtins engine friendly) error messages when "exec" and "print" are used as statements. -- Issue #21642: If the conditional if-else expression, allow an integer written +- Issue #21642: In the conditional if-else expression, allow an integer written with no space between itself and the ``else`` keyword (e.g. ``True if 42else False``) to be valid syntax. diff --git a/Modules/_io/stringio.c b/Modules/_io/stringio.c index 9d73884f731..95fb703eb0f 100644 --- a/Modules/_io/stringio.c +++ b/Modules/_io/stringio.c @@ -711,7 +711,7 @@ stringio_init(stringio *self, PyObject *args, PyObject *kwds) /* If newline == "", we don't translate anything. If newline == "\n" or newline == None, we translate to "\n", which is a no-op. - (for newline == None, TextIOWrapper translates to os.sepline, but it + (for newline == None, TextIOWrapper translates to os.linesep, but it is pointless for StringIO) */ if (newline != NULL && newline[0] == '\r') { diff --git a/Objects/object.c b/Objects/object.c index a1a69fa123e..307e3ac3215 100644 --- a/Objects/object.c +++ b/Objects/object.c @@ -459,7 +459,7 @@ PyObject_Repr(PyObject *v) #ifdef Py_DEBUG /* PyObject_Repr() must not be called with an exception set, because it may clear it (directly or indirectly) and so the - caller looses its exception */ + caller loses its exception */ assert(!PyErr_Occurred()); #endif diff --git a/Objects/typeobject.c b/Objects/typeobject.c index cf4e4e57dac..09c895c8c9d 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -876,7 +876,7 @@ type_call(PyTypeObject *type, PyObject *args, PyObject *kwds) #ifdef Py_DEBUG /* type_call() must not be called with an exception set, because it may clear it (directly or indirectly) and so the - caller looses its exception */ + caller loses its exception */ assert(!PyErr_Occurred()); #endif diff --git a/PC/VS9.0/kill_python.c b/PC/VS9.0/kill_python.c index 604731f3f81..666e1b0297c 100644 --- a/PC/VS9.0/kill_python.c +++ b/PC/VS9.0/kill_python.c @@ -108,7 +108,7 @@ main(int argc, char **argv) * modules for all processes (not just the python[_d].exe ones) * and see if any of our DLLs are loaded (i.e. python34[_d].dll), * as that would also inhibit our ability to rebuild the solution. - * Not worth loosing sleep over though; for now, a simple check + * Not worth losing sleep over though; for now, a simple check * for just the python executable should be sufficient. */ diff --git a/PCbuild/kill_python.c b/PCbuild/kill_python.c index 604731f3f81..666e1b0297c 100644 --- a/PCbuild/kill_python.c +++ b/PCbuild/kill_python.c @@ -108,7 +108,7 @@ main(int argc, char **argv) * modules for all processes (not just the python[_d].exe ones) * and see if any of our DLLs are loaded (i.e. python34[_d].dll), * as that would also inhibit our ability to rebuild the solution. - * Not worth loosing sleep over though; for now, a simple check + * Not worth losing sleep over though; for now, a simple check * for just the python executable should be sufficient. */ diff --git a/Python/ceval.c b/Python/ceval.c index 275229858e2..7a0cb7f04ab 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -1212,7 +1212,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag) #ifdef Py_DEBUG /* PyEval_EvalFrameEx() must not be called with an exception set, because it may clear it (directly or indirectly) and so the - caller looses its exception */ + caller loses its exception */ assert(!PyErr_Occurred()); #endif @@ -4087,7 +4087,7 @@ PyEval_CallObjectWithKeywords(PyObject *func, PyObject *arg, PyObject *kw) #ifdef Py_DEBUG /* PyEval_CallObjectWithKeywords() must not be called with an exception set, because it may clear it (directly or indirectly) - and so the caller looses its exception */ + and so the caller loses its exception */ assert(!PyErr_Occurred()); #endif From ec1aa5c2a1d0848351dd9d7d2758c553f18e56b2 Mon Sep 17 00:00:00 2001 From: Martin Panter Date: Wed, 7 Oct 2015 11:03:53 +0000 Subject: [PATCH 2/2] More typos in 3.5 documentation and comments --- Lib/test/test_time.py | 4 ++-- Misc/NEWS | 4 ++-- Objects/abstract.c | 2 +- Objects/methodobject.c | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Lib/test/test_time.py b/Lib/test/test_time.py index de0cbc4020f..76b894eece4 100644 --- a/Lib/test/test_time.py +++ b/Lib/test/test_time.py @@ -773,7 +773,7 @@ class TestPyTime_t(unittest.TestCase): (2**23 - 1e-9, 8388607999999999), (2**23, 8388608000000000), - # start loosing precision for value > 2^23 seconds + # start losing precision for value > 2^23 seconds (2**23 + 1e-9, 8388608000000002), # nanoseconds are lost for value > 2^23 seconds @@ -848,7 +848,7 @@ class TestPyTime_t(unittest.TestCase): (4194304000000000, 2**22), (4194304000000001, 2**22 + 1e-9), - # start loosing precision for value > 2^23 seconds + # start losing precision for value > 2^23 seconds (8388608000000002, 2**23 + 1e-9), # nanoseconds are lost for value > 2^23 seconds diff --git a/Misc/NEWS b/Misc/NEWS index e0ac4fcc96d..e055bd5db00 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -285,7 +285,7 @@ Build ----- - Issue #24915: Add LLVM support for PGO builds and use the test suite to - generate the profile data. Initiial patch by Alecsandru Patrascu of Intel. + generate the profile data. Initial patch by Alecsandru Patrascu of Intel. - Issue #24910: Windows MSIs now have unique display names. @@ -1693,7 +1693,7 @@ Core and Builtins type) can now be weakref'ed. Patch by Wei Wu. - Issue #22077: Improve index error messages for bytearrays, bytes, lists, - and tuples by adding 'or slices'. Added ', not ' for bytearrays. Original patch by Claudiu Popa. - Issue #20179: Apply Argument Clinic to bytes and bytearray. diff --git a/Objects/abstract.c b/Objects/abstract.c index 31cc0a8ba51..039a4ca052c 100644 --- a/Objects/abstract.c +++ b/Objects/abstract.c @@ -2131,7 +2131,7 @@ PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) /* PyObject_Call() must not be called with an exception set, because it may clear it (directly or indirectly) and so the - caller looses its exception */ + caller loses its exception */ assert(!PyErr_Occurred()); call = func->ob_type->tp_call; diff --git a/Objects/methodobject.c b/Objects/methodobject.c index 1817722940a..946357f24a9 100644 --- a/Objects/methodobject.c +++ b/Objects/methodobject.c @@ -89,7 +89,7 @@ PyCFunction_Call(PyObject *func, PyObject *args, PyObject *kwds) /* PyCFunction_Call() must not be called with an exception set, because it may clear it (directly or indirectly) and so the - caller looses its exception */ + caller loses its exception */ assert(!PyErr_Occurred()); flags = PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST);