Fix typos mostly in comments, docs and test names (GH-15209)

This commit is contained in:
Min ho Kim 2019-08-31 06:21:19 +10:00 committed by Terry Jan Reedy
parent 15119bc2a7
commit 39d87b5471
46 changed files with 60 additions and 60 deletions

View File

@ -876,7 +876,7 @@ Path Configuration
If at least one "output field" is not set, Python computes the path If at least one "output field" is not set, Python computes the path
configuration to fill unset fields. If configuration to fill unset fields. If
:c:member:`~PyConfig.module_search_paths_set` is equal to 0, :c:member:`~PyConfig.module_search_paths_set` is equal to 0,
:c:member:`~PyConfig.module_search_paths` is overriden and :c:member:`~PyConfig.module_search_paths` is overridden and
:c:member:`~PyConfig.module_search_paths_set` is set to 1. :c:member:`~PyConfig.module_search_paths_set` is set to 1.
It is possible to completely ignore the function computing the default It is possible to completely ignore the function computing the default

View File

@ -1379,8 +1379,8 @@ an :term:`importer`.
bytecode file. An empty string represents no optimization, so bytecode file. An empty string represents no optimization, so
``/foo/bar/baz.py`` with an *optimization* of ``''`` will result in a ``/foo/bar/baz.py`` with an *optimization* of ``''`` will result in a
bytecode path of ``/foo/bar/__pycache__/baz.cpython-32.pyc``. ``None`` causes bytecode path of ``/foo/bar/__pycache__/baz.cpython-32.pyc``. ``None`` causes
the interpter's optimization level to be used. Any other value's string the interpreter's optimization level to be used. Any other value's string
representation being used, so ``/foo/bar/baz.py`` with an *optimization* of representation is used, so ``/foo/bar/baz.py`` with an *optimization* of
``2`` will lead to the bytecode path of ``2`` will lead to the bytecode path of
``/foo/bar/__pycache__/baz.cpython-32.opt-2.pyc``. The string representation ``/foo/bar/__pycache__/baz.cpython-32.opt-2.pyc``. The string representation
of *optimization* can only be alphanumeric, else :exc:`ValueError` is raised. of *optimization* can only be alphanumeric, else :exc:`ValueError` is raised.

View File

@ -119,7 +119,7 @@ PyAPI_FUNC(PyHash_FuncDef*) PyHash_GetFuncDef(void);
* configure script. * configure script.
* *
* - FNV is available on all platforms and architectures. * - FNV is available on all platforms and architectures.
* - SIPHASH24 only works on plaforms that don't require aligned memory for integers. * - SIPHASH24 only works on platforms that don't require aligned memory for integers.
* - With EXTERNAL embedders can provide an alternative implementation with:: * - With EXTERNAL embedders can provide an alternative implementation with::
* *
* PyHash_FuncDef PyHash_Func = {...}; * PyHash_FuncDef PyHash_Func = {...};

View File

@ -71,7 +71,7 @@ def connect(host=None, port=None, *,
ssl_handshake_timeout=None, ssl_handshake_timeout=None,
happy_eyeballs_delay=None, interleave=None): happy_eyeballs_delay=None, interleave=None):
# Design note: # Design note:
# Don't use decorator approach but exilicit non-async # Don't use decorator approach but explicit non-async
# function to fail fast and explicitly # function to fail fast and explicitly
# if passed arguments don't match the function signature # if passed arguments don't match the function signature
return _ContextManagerHelper(_connect(host, port, limit, return _ContextManagerHelper(_connect(host, port, limit,
@ -442,7 +442,7 @@ if hasattr(socket, 'AF_UNIX'):
ssl_handshake_timeout=None): ssl_handshake_timeout=None):
"""Similar to `connect()` but works with UNIX Domain Sockets.""" """Similar to `connect()` but works with UNIX Domain Sockets."""
# Design note: # Design note:
# Don't use decorator approach but exilicit non-async # Don't use decorator approach but explicit non-async
# function to fail fast and explicitly # function to fail fast and explicitly
# if passed arguments don't match the function signature # if passed arguments don't match the function signature
return _ContextManagerHelper(_connect_unix(path, return _ContextManagerHelper(_connect_unix(path,

View File

@ -38,7 +38,7 @@ class Bdb:
"""Return canonical form of filename. """Return canonical form of filename.
For real filenames, the canonical form is a case-normalized (on For real filenames, the canonical form is a case-normalized (on
case insenstive filesystems) absolute path. 'Filenames' with case insensitive filesystems) absolute path. 'Filenames' with
angle brackets, such as "<stdin>", generated in interactive angle brackets, such as "<stdin>", generated in interactive
mode, are returned unchanged. mode, are returned unchanged.
""" """

View File

@ -238,7 +238,7 @@ class Finalize(object):
if self._kwargs: if self._kwargs:
x += ', kwargs=' + str(self._kwargs) x += ', kwargs=' + str(self._kwargs)
if self._key[0] is not None: if self._key[0] is not None:
x += ', exitprority=' + str(self._key[0]) x += ', exitpriority=' + str(self._key[0])
return x + '>' return x + '>'

View File

@ -467,7 +467,7 @@ class ConditionTests(BaseTestCase):
# of the workers. # of the workers.
# Secondly, this test assumes that condition variables are not subject # Secondly, this test assumes that condition variables are not subject
# to spurious wakeups. The absence of spurious wakeups is an implementation # to spurious wakeups. The absence of spurious wakeups is an implementation
# detail of Condition Cariables in current CPython, but in general, not # detail of Condition Variables in current CPython, but in general, not
# a guaranteed property of condition variables as a programming # a guaranteed property of condition variables as a programming
# construct. In particular, it is possible that this can no longer # construct. In particular, it is possible that this can no longer
# be conveniently guaranteed should their implementation ever change. # be conveniently guaranteed should their implementation ever change.

View File

@ -474,7 +474,7 @@ class CmdLineTest(unittest.TestCase):
('os.path', br'loader.*cannot handle'), ('os.path', br'loader.*cannot handle'),
('importlib', br'No module named.*' ('importlib', br'No module named.*'
br'is a package and cannot be directly executed'), br'is a package and cannot be directly executed'),
('importlib.nonexistant', br'No module named'), ('importlib.nonexistent', br'No module named'),
('.unittest', br'Relative module names not supported'), ('.unittest', br'Relative module names not supported'),
) )
for name, regex in tests: for name, regex in tests:

View File

@ -1927,7 +1927,7 @@ class TestCounter(unittest.TestCase):
'r', 'c', 'd', ' ', 's', 's', 'i', 'i', 'm', 'm', 'l']) 'r', 'c', 'd', ' ', 's', 's', 'i', 'i', 'm', 'm', 'l'])
# Math operations order first by the order encountered in the left # Math operations order first by the order encountered in the left
# operand and then by the order encounted in the right operand. # operand and then by the order encountered in the right operand.
ps = 'aaabbcdddeefggghhijjjkkl' ps = 'aaabbcdddeefggghhijjjkkl'
qs = 'abbcccdeefffhkkllllmmnno' qs = 'abbcccdeefffhkkllllmmnno'
order = {letter: i for i, letter in enumerate(dict.fromkeys(ps + qs))} order = {letter: i for i, letter in enumerate(dict.fromkeys(ps + qs))}

View File

@ -3025,7 +3025,7 @@ order (MRO) for bases """
# Testing a str subclass used as dict key .. # Testing a str subclass used as dict key ..
class cistr(str): class cistr(str):
"""Sublcass of str that computes __eq__ case-insensitively. """Subclass of str that computes __eq__ case-insensitively.
Also computes a hash code of the string in canonical form. Also computes a hash code of the string in canonical form.
""" """

View File

@ -48,7 +48,7 @@ def testformat(formatstr, args, output=None, limit=None, overflowok=False):
def testcommon(formatstr, args, output=None, limit=None, overflowok=False): def testcommon(formatstr, args, output=None, limit=None, overflowok=False):
# if formatstr is a str, test str, bytes, and bytearray; # if formatstr is a str, test str, bytes, and bytearray;
# otherwise, test bytes and bytearry # otherwise, test bytes and bytearray
if isinstance(formatstr, str): if isinstance(formatstr, str):
testformat(formatstr, args, output, limit, overflowok) testformat(formatstr, args, output, limit, overflowok)
b_format = formatstr.encode('ascii') b_format = formatstr.encode('ascii')

View File

@ -912,7 +912,7 @@ class GCCallbackTests(unittest.TestCase):
def test_collect_garbage(self): def test_collect_garbage(self):
self.preclean() self.preclean()
# Each of these cause four objects to be garbage: Two # Each of these cause four objects to be garbage: Two
# Uncolectables and their instance dicts. # Uncollectables and their instance dicts.
Uncollectable() Uncollectable()
Uncollectable() Uncollectable()
C1055820(666) C1055820(666)

View File

@ -445,7 +445,7 @@ class CompareDigestTestCase(unittest.TestCase):
a, b = bytearray(b"foobar"), bytearray(b"foobar") a, b = bytearray(b"foobar"), bytearray(b"foobar")
self.assertTrue(hmac.compare_digest(a, b)) self.assertTrue(hmac.compare_digest(a, b))
# Testing bytearrays of diffeent lengths # Testing bytearrays of different lengths
a, b = bytearray(b"foobar"), bytearray(b"foo") a, b = bytearray(b"foobar"), bytearray(b"foo")
self.assertFalse(hmac.compare_digest(a, b)) self.assertFalse(hmac.compare_digest(a, b))
@ -458,7 +458,7 @@ class CompareDigestTestCase(unittest.TestCase):
self.assertTrue(hmac.compare_digest(a, b)) self.assertTrue(hmac.compare_digest(a, b))
self.assertTrue(hmac.compare_digest(b, a)) self.assertTrue(hmac.compare_digest(b, a))
# Testing byte bytearray of diffeent lengths # Testing byte bytearray of different lengths
a, b = bytearray(b"foobar"), b"foo" a, b = bytearray(b"foobar"), b"foo"
self.assertFalse(hmac.compare_digest(a, b)) self.assertFalse(hmac.compare_digest(a, b))
self.assertFalse(hmac.compare_digest(b, a)) self.assertFalse(hmac.compare_digest(b, a))
@ -472,7 +472,7 @@ class CompareDigestTestCase(unittest.TestCase):
a, b = "foobar", "foobar" a, b = "foobar", "foobar"
self.assertTrue(hmac.compare_digest(a, b)) self.assertTrue(hmac.compare_digest(a, b))
# Testing str of diffeent lengths # Testing str of different lengths
a, b = "foo", "foobar" a, b = "foo", "foobar"
self.assertFalse(hmac.compare_digest(a, b)) self.assertFalse(hmac.compare_digest(a, b))

View File

@ -325,7 +325,7 @@ class SimpleTest(abc.LoaderTests):
) )
@util.writes_bytecode_files @util.writes_bytecode_files
def test_overiden_unchecked_hash_based_pyc(self): def test_overridden_unchecked_hash_based_pyc(self):
with util.create_modules('_temp') as mapping, \ with util.create_modules('_temp') as mapping, \
unittest.mock.patch('_imp.check_hash_based_pycs', 'always'): unittest.mock.patch('_imp.check_hash_based_pycs', 'always'):
source = mapping['_temp'] source = mapping['_temp']

View File

@ -32,7 +32,7 @@ class BasicTests(fixtures.DistInfoPkg, unittest.TestCase):
class ImportTests(fixtures.DistInfoPkg, unittest.TestCase): class ImportTests(fixtures.DistInfoPkg, unittest.TestCase):
def test_import_nonexistent_module(self): def test_import_nonexistent_module(self):
# Ensure that the MetadataPathFinder does not crash an import of a # Ensure that the MetadataPathFinder does not crash an import of a
# non-existant module. # non-existent module.
with self.assertRaises(ImportError): with self.assertRaises(ImportError):
importlib.import_module('does_not_exist') importlib.import_module('does_not_exist')

View File

@ -443,7 +443,7 @@ def create_package(file, path, is_package=True, contents=()):
yield entry yield entry
name = 'testingpackage' name = 'testingpackage'
# Unforunately importlib.util.module_from_spec() was not introduced until # Unfortunately importlib.util.module_from_spec() was not introduced until
# Python 3.5. # Python 3.5.
module = types.ModuleType(name) module = types.ModuleType(name)
loader = Reader() loader = Reader()

View File

@ -1810,13 +1810,13 @@ class TestMode(NumericTestCase, AverageMixin, UnivariateTypeMixin):
# Test mode with bimodal data. # Test mode with bimodal data.
data = [1, 1, 2, 2, 2, 2, 3, 4, 5, 6, 6, 6, 6, 7, 8, 9, 9] data = [1, 1, 2, 2, 2, 2, 3, 4, 5, 6, 6, 6, 6, 7, 8, 9, 9]
assert data.count(2) == data.count(6) == 4 assert data.count(2) == data.count(6) == 4
# mode() should return 2, the first encounted mode # mode() should return 2, the first encountered mode
self.assertEqual(self.func(data), 2) self.assertEqual(self.func(data), 2)
def test_unique_data(self): def test_unique_data(self):
# Test mode when data points are all unique. # Test mode when data points are all unique.
data = list(range(10)) data = list(range(10))
# mode() should return 0, the first encounted mode # mode() should return 0, the first encountered mode
self.assertEqual(self.func(data), 0) self.assertEqual(self.func(data), 0)
def test_none_data(self): def test_none_data(self):

View File

@ -885,7 +885,7 @@ class TestCommandLine(unittest.TestCase):
return return
if b'PYTHONTRACEMALLOC: invalid number of frames' in stderr: if b'PYTHONTRACEMALLOC: invalid number of frames' in stderr:
return return
self.fail(f"unexpeced output: {stderr!a}") self.fail(f"unexpected output: {stderr!a}")
def test_env_var_invalid(self): def test_env_var_invalid(self):
@ -914,7 +914,7 @@ class TestCommandLine(unittest.TestCase):
return return
if b'-X tracemalloc=NFRAME: invalid number of frames' in stderr: if b'-X tracemalloc=NFRAME: invalid number of frames' in stderr:
return return
self.fail(f"unexpeced output: {stderr!a}") self.fail(f"unexpected output: {stderr!a}")
def test_sys_xoptions_invalid(self): def test_sys_xoptions_invalid(self):
for nframe in INVALID_NFRAME: for nframe in INVALID_NFRAME:

View File

@ -714,7 +714,7 @@ class _WarningsTests(BaseTest, unittest.TestCase):
self.assertRaises(TypeError, self.module.warn, "Warning!") self.assertRaises(TypeError, self.module.warn, "Warning!")
def test_show_warning_output(self): def test_show_warning_output(self):
# With showarning() missing, make sure that output is okay. # With showwarning() missing, make sure that output is okay.
text = 'test show_warning' text = 'test show_warning'
with original_warnings.catch_warnings(module=self.module): with original_warnings.catch_warnings(module=self.module):
self.module.filterwarnings("always", category=UserWarning) self.module.filterwarnings("always", category=UserWarning)

View File

@ -229,7 +229,7 @@ class LocalWinregTests(BaseWinregTests):
h.Close() h.Close()
self.assertEqual(h.handle, 0) self.assertEqual(h.handle, 0)
def test_inexistant_remote_registry(self): def test_nonexistent_remote_registry(self):
connect = lambda: ConnectRegistry("abcdefghijkl", HKEY_CURRENT_USER) connect = lambda: ConnectRegistry("abcdefghijkl", HKEY_CURRENT_USER)
self.assertRaises(OSError, connect) self.assertRaises(OSError, connect)

View File

@ -586,10 +586,10 @@ class HandlerTests(TestCase):
expected.update({ expected.update({
# X doesn't exist in os_environ # X doesn't exist in os_environ
"X": "Y", "X": "Y",
# HOME is overriden by TestHandler # HOME is overridden by TestHandler
'HOME': "/override/home", 'HOME': "/override/home",
# overriden by setup_testing_defaults() # overridden by setup_testing_defaults()
"SCRIPT_NAME": "", "SCRIPT_NAME": "",
"SERVER_NAME": "127.0.0.1", "SERVER_NAME": "127.0.0.1",

View File

@ -469,7 +469,7 @@ def test():
except (ImportError, AttributeError): except (ImportError, AttributeError):
pass pass
# dialog for openening files # dialog for opening files
openfilename=askopenfilename(filetypes=[("all files", "*")]) openfilename=askopenfilename(filetypes=[("all files", "*")])
try: try:

View File

@ -1651,7 +1651,7 @@ class PatchTest(unittest.TestCase):
p1.stop() p1.stop()
self.assertEqual(squizz.squozz, 3) self.assertEqual(squizz.squozz, 3)
def test_patch_propogrates_exc_on_exit(self): def test_patch_propagates_exc_on_exit(self):
class holder: class holder:
exc_info = None, None, None exc_info = None, None, None
@ -1680,9 +1680,9 @@ class PatchTest(unittest.TestCase):
self.assertIs(holder.exc_info[0], RuntimeError) self.assertIs(holder.exc_info[0], RuntimeError)
self.assertIsNotNone(holder.exc_info[1], self.assertIsNotNone(holder.exc_info[1],
'exception value not propgated') 'exception value not propagated')
self.assertIsNotNone(holder.exc_info[2], self.assertIsNotNone(holder.exc_info[2],
'exception traceback not propgated') 'exception traceback not propagated')
def test_create_and_specs(self): def test_create_and_specs(self):

View File

@ -680,7 +680,7 @@ def _random_getnode():
return random.getrandbits(48) | (1 << 40) return random.getrandbits(48) | (1 << 40)
# _OS_GETTERS, when known, are targetted for a specific OS or platform. # _OS_GETTERS, when known, are targeted for a specific OS or platform.
# The order is by 'common practice' on the specified platform. # The order is by 'common practice' on the specified platform.
# Note: 'posix' and 'windows' _OS_GETTERS are prefixed by a dll/dlload() method # Note: 'posix' and 'windows' _OS_GETTERS are prefixed by a dll/dlload() method
# which, when successful, means none of these "external" methods are called. # which, when successful, means none of these "external" methods are called.

View File

@ -1231,7 +1231,7 @@ Library
- Issue #22448: Improve canceled timer handles cleanup to prevent - Issue #22448: Improve canceled timer handles cleanup to prevent
unbound memory usage. Patch by Joshua Moore-Oliva. unbound memory usage. Patch by Joshua Moore-Oliva.
- Issue #23009: Make sure selectors.EpollSelecrtor.select() works when no - Issue #23009: Make sure selectors.EpollSelector.select() works when no
FD is registered. FD is registered.
IDLE IDLE
@ -16660,7 +16660,7 @@ Core and Builtins
Exception (KeyboardInterrupt, and SystemExit) propagate instead of Exception (KeyboardInterrupt, and SystemExit) propagate instead of
ignoring them. ignoring them.
- #3021 Exception reraising sematics have been significantly improved. However, - #3021 Exception reraising semantics have been significantly improved. However,
f_exc_type, f_exc_value, and f_exc_traceback cannot be accessed from Python f_exc_type, f_exc_value, and f_exc_traceback cannot be accessed from Python
code anymore. code anymore.

View File

@ -1255,7 +1255,7 @@ Support wrapped callables in doctest. Patch by Claudiu Popa.
.. nonce: -sW7gk .. nonce: -sW7gk
.. section: Library .. section: Library
Make sure selectors.EpollSelecrtor.select() works when no FD is registered. Make sure selectors.EpollSelector.select() works when no FD is registered.
.. ..

View File

@ -913,7 +913,7 @@ Fixed infinite recursion in the repr of uninitialized ctypes.CDLL instances.
Fixed race condition in C implementation of functools.lru_cache. KeyError Fixed race condition in C implementation of functools.lru_cache. KeyError
could be raised when cached function with full cache was simultaneously could be raised when cached function with full cache was simultaneously
called from differen threads with the same uncached arguments. called from different threads with the same uncached arguments.
.. ..

View File

@ -1148,7 +1148,7 @@ dict constraint in ForwardRef._eval_type (upstream #252)
.. nonce: hxh6_h .. nonce: hxh6_h
.. section: Library .. section: Library
Make ``_normalize`` parameter to ``Fraction`` constuctor keyword-only, so Make ``_normalize`` parameter to ``Fraction`` constructor keyword-only, so
that ``Fraction(2, 3, 4)`` now raises ``TypeError``. that ``Fraction(2, 3, 4)`` now raises ``TypeError``.
.. ..

View File

@ -48,7 +48,7 @@ they still are deprecated and will be disabled in 3.7.
.. section: Library .. section: Library
Fix a regression introduced in warnings.catch_warnings(): call Fix a regression introduced in warnings.catch_warnings(): call
warnings.showwarning() if it was overriden inside the context manager. warnings.showwarning() if it was overridden inside the context manager.
.. ..

View File

@ -435,7 +435,7 @@ Fix an important omission by adding Deque to the typing module.
Fixed race condition in C implementation of functools.lru_cache. KeyError Fixed race condition in C implementation of functools.lru_cache. KeyError
could be raised when cached function with full cache was simultaneously could be raised when cached function with full cache was simultaneously
called from differen threads with the same uncached arguments. called from different threads with the same uncached arguments.
.. ..

View File

@ -3651,7 +3651,7 @@ regular expression objects.
Fixed race condition in C implementation of functools.lru_cache. KeyError Fixed race condition in C implementation of functools.lru_cache. KeyError
could be raised when cached function with full cache was simultaneously could be raised when cached function with full cache was simultaneously
called from differen threads with the same uncached arguments. called from different threads with the same uncached arguments.
.. ..

View File

@ -2418,7 +2418,7 @@ over browsers in the ``BROWSER`` environment variable.
.. nonce: eSLKBE .. nonce: eSLKBE
.. section: Library .. section: Library
Avoid stripping trailing whitespace in doctest fancy diff. Orignial patch by Avoid stripping trailing whitespace in doctest fancy diff. Original patch by
R. David Murray & Jairo Trad. Enhanced by Sanyam Khurana. R. David Murray & Jairo Trad. Enhanced by Sanyam Khurana.
.. ..

View File

@ -1110,7 +1110,7 @@ Add ``-fmax-type-align=8`` to CFLAGS when clang compiler is detected. The
pymalloc memory allocator aligns memory on 8 bytes. On x86-64, clang expects pymalloc memory allocator aligns memory on 8 bytes. On x86-64, clang expects
alignment on 16 bytes by default and so uses MOVAPS instruction which can alignment on 16 bytes by default and so uses MOVAPS instruction which can
lead to segmentation fault. Instruct clang that Python is limited to lead to segmentation fault. Instruct clang that Python is limited to
alignemnt on 8 bytes to use MOVUPS instruction instead: slower but don't alignment on 8 bytes to use MOVUPS instruction instead: slower but don't
trigger a SIGSEGV if the memory is not aligned on 16 bytes. Sadly, the flag trigger a SIGSEGV if the memory is not aligned on 16 bytes. Sadly, the flag
must be added to ``CFLAGS`` and not just ``CFLAGS_NODIST``, since third must be added to ``CFLAGS`` and not just ``CFLAGS_NODIST``, since third
party C extensions can have the same issue. party C extensions can have the same issue.

View File

@ -1262,7 +1262,7 @@ Reinitialize logging.Handler locks in forked child processes instead of
attempting to acquire them all in the parent before forking only to be attempting to acquire them all in the parent before forking only to be
released in the child process. The acquire/release pattern was leading to released in the child process. The acquire/release pattern was leading to
deadlocks in code that has implemented any form of chained logging handlers deadlocks in code that has implemented any form of chained logging handlers
that depend upon one another as the lock acquision order cannot be that depend upon one another as the lock acquisition order cannot be
guaranteed. guaranteed.
.. ..

View File

@ -110,7 +110,7 @@ static void pymem_destructor(PyObject *ptr)
WinDLL(..., use_last_error=True) swap the system LastError value with the WinDLL(..., use_last_error=True) swap the system LastError value with the
ctypes private copy. ctypes private copy.
The values are also swapped immeditately before and after ctypes callback The values are also swapped immediately before and after ctypes callback
functions are called, if the callbacks are constructed using the new functions are called, if the callbacks are constructed using the new
optional use_errno parameter set to True: CFUNCTYPE(..., use_errno=TRUE) or optional use_errno parameter set to True: CFUNCTYPE(..., use_errno=TRUE) or
WINFUNCTYPE(..., use_errno=True). WINFUNCTYPE(..., use_errno=True).

View File

@ -352,7 +352,7 @@ PyCStructUnionType_update_stgdict(PyObject *type, PyObject *fields, int isStruct
int big_endian; int big_endian;
/* HACK Alert: I cannot be bothered to fix ctypes.com, so there has to /* HACK Alert: I cannot be bothered to fix ctypes.com, so there has to
be a way to use the old, broken sematics: _fields_ are not extended be a way to use the old, broken semantics: _fields_ are not extended
but replaced in subclasses. but replaced in subclasses.
XXX Remove this in ctypes 1.0! XXX Remove this in ctypes 1.0!

View File

@ -841,7 +841,7 @@ bytesio_setstate(bytesio *self, PyObject *state)
/* Set carefully the position value. Alternatively, we could use the seek /* Set carefully the position value. Alternatively, we could use the seek
method instead of modifying self->pos directly to better protect the method instead of modifying self->pos directly to better protect the
object internal state against errneous (or malicious) inputs. */ object internal state against erroneous (or malicious) inputs. */
position_obj = PyTuple_GET_ITEM(state, 1); position_obj = PyTuple_GET_ITEM(state, 1);
if (!PyLong_Check(position_obj)) { if (!PyLong_Check(position_obj)) {
PyErr_Format(PyExc_TypeError, PyErr_Format(PyExc_TypeError,

View File

@ -899,7 +899,7 @@ stringio_setstate(stringio *self, PyObject *state)
/* Set carefully the position value. Alternatively, we could use the seek /* Set carefully the position value. Alternatively, we could use the seek
method instead of modifying self->pos directly to better protect the method instead of modifying self->pos directly to better protect the
object internal state against errneous (or malicious) inputs. */ object internal state against erroneous (or malicious) inputs. */
position_obj = PyTuple_GET_ITEM(state, 2); position_obj = PyTuple_GET_ITEM(state, 2);
if (!PyLong_Check(position_obj)) { if (!PyLong_Check(position_obj)) {
PyErr_Format(PyExc_TypeError, PyErr_Format(PyExc_TypeError,

View File

@ -4634,7 +4634,7 @@ check_pyobject_forbidden_bytes_is_freed(PyObject *self, PyObject *Py_UNUSED(args
/* Initialize reference count to avoid early crash in ceval or GC */ /* Initialize reference count to avoid early crash in ceval or GC */
Py_REFCNT(op) = 1; Py_REFCNT(op) = 1;
/* ob_type field is after the memory block: part of "forbidden bytes" /* ob_type field is after the memory block: part of "forbidden bytes"
when using debug hooks on memory allocatrs! */ when using debug hooks on memory allocators! */
return test_pyobject_is_freed("check_pyobject_forbidden_bytes_is_freed", op); return test_pyobject_is_freed("check_pyobject_forbidden_bytes_is_freed", op);
} }

View File

@ -53,12 +53,12 @@ typedef HMODULE (APIENTRY *LOADLIBRARYEX_FN)(LPCTSTR, HANDLE, DWORD);
/* See function definitions in winbase.h */ /* See function definitions in winbase.h */
#ifdef UNICODE #ifdef UNICODE
# ifdef _WIN32_WCE # ifdef _WIN32_WCE
# define LOADLIBARYEX L"LoadLibraryExW" # define LOADLIBRARYEX L"LoadLibraryExW"
# else # else
# define LOADLIBARYEX "LoadLibraryExW" # define LOADLIBRARYEX "LoadLibraryExW"
# endif # endif
#else #else
# define LOADLIBARYEX "LoadLibraryExA" # define LOADLIBRARYEX "LoadLibraryExA"
#endif #endif
@ -88,7 +88,7 @@ HMODULE _Expat_LoadLibrary(LPCTSTR filename)
/* Attempt to find LoadLibraryEx() which is only available on Windows 2000 /* Attempt to find LoadLibraryEx() which is only available on Windows 2000
and above */ and above */
pLoadLibraryEx = (LOADLIBRARYEX_FN) GetProcAddress(hKernel32, LOADLIBARYEX); pLoadLibraryEx = (LOADLIBRARYEX_FN) GetProcAddress(hKernel32, LOADLIBRARYEX);
/* Detect if there's already a path in the filename and load the library if /* Detect if there's already a path in the filename and load the library if
there is. Note: Both back slashes and forward slashes have been supported there is. Note: Both back slashes and forward slashes have been supported

View File

@ -3399,7 +3399,7 @@ storeAtts(XML_Parser parser, const ENCODING *enc,
* has to have passed through the hash table lookup once * has to have passed through the hash table lookup once
* already. That implies that an entry for it already * already. That implies that an entry for it already
* exists, so the lookup above will return a pointer to * exists, so the lookup above will return a pointer to
* already allocated memory. There is no opportunaity for * already allocated memory. There is no opportunity for
* the allocator to fail, so the condition above cannot be * the allocator to fail, so the condition above cannot be
* fulfilled. * fulfilled.
* *

View File

@ -18,7 +18,7 @@
#include <sys/ioctl.h> #include <sys/ioctl.h>
/* HP-UX requires that this be included to pick up MDCD, MCTS, MDSR, /* HP-UX requires that this be included to pick up MDCD, MCTS, MDSR,
* MDTR, MRI, and MRTS (appearantly used internally by some things * MDTR, MRI, and MRTS (apparently used internally by some things
* defined as macros; these are not used here directly). * defined as macros; these are not used here directly).
*/ */
#ifdef HAVE_SYS_MODEM_H #ifdef HAVE_SYS_MODEM_H

View File

@ -328,7 +328,7 @@ found is still high in the memory hierarchy. We also can't delay merging
unmerged, and the stack has a fixed size. unmerged, and the stack has a fixed size.
What turned out to be a good compromise maintains two invariants on the What turned out to be a good compromise maintains two invariants on the
stack entries, where A, B and C are the lengths of the three righmost not-yet stack entries, where A, B and C are the lengths of the three rightmost not-yet
merged slices: merged slices:
1. A > B+C 1. A > B+C

View File

@ -117,7 +117,7 @@ find_signature(const char *name, const char *doc)
#define SIGNATURE_END_MARKER ")\n--\n\n" #define SIGNATURE_END_MARKER ")\n--\n\n"
#define SIGNATURE_END_MARKER_LENGTH 6 #define SIGNATURE_END_MARKER_LENGTH 6
/* /*
* skips past the end of the docstring's instrospection signature. * skips past the end of the docstring's introspection signature.
* (assumes doc starts with a valid signature prefix.) * (assumes doc starts with a valid signature prefix.)
*/ */
static const char * static const char *

View File

@ -5356,7 +5356,7 @@ typedef struct {
doubling the number allocated each time. Note that the f-string doubling the number allocated each time. Note that the f-string
f'{0}a{1}' contains 3 expr_ty's: 2 FormattedValue's, and one f'{0}a{1}' contains 3 expr_ty's: 2 FormattedValue's, and one
Constant for the literal 'a'. So you add expr_ty's about twice as Constant for the literal 'a'. So you add expr_ty's about twice as
fast as you add exressions in an f-string. */ fast as you add expressions in an f-string. */
Py_ssize_t allocated; /* Number we've allocated. */ Py_ssize_t allocated; /* Number we've allocated. */
Py_ssize_t size; /* Number we've used. */ Py_ssize_t size; /* Number we've used. */

View File

@ -729,7 +729,7 @@ PyState_RemoveModule(struct PyModuleDef* def)
return -1; return -1;
} }
if (state->modules_by_index == NULL) { if (state->modules_by_index == NULL) {
Py_FatalError("PyState_RemoveModule: Interpreters module-list not acessible."); Py_FatalError("PyState_RemoveModule: Interpreters module-list not accessible.");
return -1; return -1;
} }
if (index > PyList_GET_SIZE(state->modules_by_index)) { if (index > PyList_GET_SIZE(state->modules_by_index)) {
@ -888,7 +888,7 @@ PyThreadState_DeleteCurrent()
* Note that, if there is a current thread state, it *must* be the one * Note that, if there is a current thread state, it *must* be the one
* passed as argument. Also, this won't touch any other interpreters * passed as argument. Also, this won't touch any other interpreters
* than the current one, since we don't know which thread state should * than the current one, since we don't know which thread state should
* be kept in those other interpreteres. * be kept in those other interpreters.
*/ */
void void
_PyThreadState_DeleteExcept(_PyRuntimeState *runtime, PyThreadState *tstate) _PyThreadState_DeleteExcept(_PyRuntimeState *runtime, PyThreadState *tstate)