]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
Fix spelling errors found by codespell
authorH <juana.galan@outlook.com>
Wed, 19 Jan 2022 20:57:35 +0000 (20:57 +0000)
committerH <juana.galan@outlook.com>
Wed, 19 Jan 2022 20:57:35 +0000 (20:57 +0000)
25 files changed:
docs/api/cursors.rst
docs/api/dns.rst
docs/api/pool.rst
psycopg/psycopg/__init__.py
psycopg/psycopg/_column.py
psycopg/psycopg/_dns.py
psycopg/psycopg/_preparing.py
psycopg/psycopg/abc.py
psycopg/psycopg/connection.py
psycopg/psycopg/cursor.py
psycopg/psycopg/pq/__init__.py
psycopg/psycopg/rows.py
psycopg/psycopg/sql.py
psycopg/psycopg/types/range.py
psycopg/psycopg/types/string.py
psycopg_c/psycopg_c/_psycopg/adapt.pyx
psycopg_c/psycopg_c/pq/pgconn.pyx
psycopg_c/psycopg_c/types/string.pyx
psycopg_pool/psycopg_pool/null_pool.py
psycopg_pool/psycopg_pool/null_pool_async.py
psycopg_pool/psycopg_pool/pool.py
psycopg_pool/psycopg_pool/pool_async.py
tests/fix_faker.py
tests/test_transaction.py
tests/test_transaction_async.py

index 947e4f6df8f6802b0c5716e661a86908d7f7a99d..74d9a16344a5ccd9034432bfdc8ece3815006b8d 100644 (file)
@@ -257,12 +257,12 @@ The `!ServerCursor` class
     .. autoattribute:: name
     .. autoattribute:: scrollable
 
-       .. seealso:: The PostgreSQL DECLARE_ statement documetation
+       .. seealso:: The PostgreSQL DECLARE_ statement documentation
           for the description of :sql:`[NO] SCROLL`.
 
     .. autoattribute:: withhold
 
-       .. seealso:: The PostgreSQL DECLARE_ statement documetation
+       .. seealso:: The PostgreSQL DECLARE_ statement documentation
           for the description of :sql:`{WITH|WITHOUT} HOLD`.
 
     .. _DECLARE: https://www.postgresql.org/docs/current/sql-declare.html
index af09a344bd47fdb686869b6411c3b6d44e696d27..84e07b9268073775ca8271de48de1b417cf20570 100644 (file)
@@ -3,7 +3,7 @@
 
 .. module:: psycopg._dns
 
-This module contains a few experimental utilities to interact wit the DNS
+This module contains a few experimental utilities to interact with the DNS
 server before performing a connection.
 
 .. warning::
index c6234cf00e407f9a833f1d80e214df1bf45e5c65..45b6cf07efb01588482bba220870861bc6c31bb4 100644 (file)
@@ -102,7 +102,7 @@ The `!ConnectionPool` class
                 ``pool-2``, etc.
    :type name: `!str`
 
-   :param timeout: The default maximum time in seconts that a client can wait
+   :param timeout: The default maximum time in seconds that a client can wait
                    to receive a connection from the pool (using `connection()`
                    or `getconn()`). Note that these methods allow to override
                    the *timeout* default.
@@ -154,7 +154,7 @@ The `!ConnectionPool` class
 
         Added *open* parameter to init method.
 
-   .. note:: In a future version, the deafult value for the *open* parameter
+   .. note:: In a future version, the default value for the *open* parameter
         might be changed to `!False`. If you rely on this behaviour (e.g. if
         you don't use the pool as a context manager) you might want to specify
         this parameter explicitly.
index 7314692ba366eaf61abcf49d952a33965584e84c..6f4068a0b6dc5a301336e6aee63032d529c9f97b 100644 (file)
@@ -36,7 +36,7 @@ logger = logging.getLogger("psycopg")
 if logger.level == logging.NOTSET:
     logger.setLevel(logging.WARNING)
 
-# DBAPI compliancy
+# DBAPI compliance
 connect = Connection.connect
 apilevel = "2.0"
 threadsafety = 2
index 30ac104b718b18d5c545e48afe9359788ccae996..ab30b4d4fff899298c722047eb2f3f8c237a5469 100644 (file)
@@ -105,7 +105,7 @@ class Column(Sequence[Any]):
 
     @property
     def internal_size(self) -> Optional[int]:
-        """The interal field size for fixed-size types, None otherwise."""
+        """The internal field size for fixed-size types, None otherwise."""
         fsize = self._data.fsize
         return fsize if fsize >= 0 else None
 
index 58e6442068c6a41a2c4dbbb2a395da72c7d90b7a..0e83d29e2508cbc210187eba9bd6ad917faecd85 100644 (file)
@@ -117,7 +117,7 @@ async def resolve_hostaddr_async(params: Dict[str, Any]) -> Dict[str, Any]:
             ans = await async_resolver.resolve(host)
         except DNSException as ex:
             # Special case localhost: on MacOS it doesn't get resolved.
-            # I assue it is just resolved by /etc/hosts, which is not handled
+            # I assume it is just resolved by /etc/hosts, which is not handled
             # by dnspython.
             if host == "localhost":
                 hosts_out.append(host)
index a9f048f0e6a450f4dd0388f1d224d2581bafe18a..d7d71d1c0f38848351f852a8f08cde610e8c1c1b 100644 (file)
@@ -163,7 +163,7 @@ class PrepareManager:
     ) -> None:
         """Validate cached entry with 'key' by checking query 'results'.
 
-        Possibly return a command to perform maintainance on database side.
+        Possibly return a command to perform maintenance on database side.
 
         Note: this method is only called in pipeline mode.
         """
index 9fb100cec8eb730a85342ddc0c3eccb19d5ddaf6..c9904600fd89c1c579cc9f07799a48c78422441a 100644 (file)
@@ -140,7 +140,7 @@ class Dumper(Protocol):
           size of int?...)
 
         In these cases, a dumper can implement `!get_key()` and return a new
-        class, or sequence of classes, that can be used to indentify the same
+        class, or sequence of classes, that can be used to identify the same
         dumper again. If the mechanism is not needed, the method should return
         the same *cls* object passed in the constructor.
 
index fce72516ab802fb69aac3d6c083de19c41b17778..3a739e9469b8ca251d0ecd1155e6e7c23fca87ca 100644 (file)
@@ -384,7 +384,7 @@ class BaseConnection(Generic[Row]):
     # to the connections subclass, which might wait either in blocking mode
     # or through asyncio.
     #
-    # All these generators assume exclusive acces to the connection: subclasses
+    # All these generators assume exclusive access to the connection: subclasses
     # should have a lock and hold it before calling and consuming them.
 
     @classmethod
index ada4e8510f308b7c043442385ea3e3addc0c6da3..423f15732a56a1243c128af34786bff44bd7ed10 100644 (file)
@@ -437,7 +437,7 @@ class BaseCursor(Generic[ConnectionType, Row]):
         self._iresult = i
         res = self.pgresult = self._results[i]
 
-        # Note: the only reason to override format is to correclty set
+        # Note: the only reason to override format is to correctly set
         # binary loaders on server-side cursors, because send_describe_portal
         # only returns a text result.
         self._tx.set_pgresult(res, format=format)
index 2339eca3ffe77e9ddb9d0473e7a57ede29806712..3cf58cef1cc47e542bbbaf4b8d1317c02de93750 100644 (file)
@@ -100,7 +100,7 @@ def import_from_libpq() -> None:
         PGcancel = module.PGcancel
         __build_version__ = getattr(module, "__build_version__", None)
     elif impl:
-        raise ImportError(f"requested psycopg impementation '{impl}' unknown")
+        raise ImportError(f"requested psycopg implementation '{impl}' unknown")
     else:
         sattempts = "\n".join(f"- {attempt}" for attempt in attempts)
         raise ImportError(
index 55574d8395240f25c629521db52f0672d0ece1bd..8032fb2d5c758e4a8470875893150d60817a17ab 100644 (file)
@@ -96,7 +96,7 @@ def tuple_row(cursor: "BaseCursor[Any, TupleRow]") -> "RowMaker[TupleRow]":
     r"""Row factory to represent rows as simple tuples.
 
     This is the default factory, used when `~psycopg.Connection.connect()` or
-    `~psycopg.Connection.cursor()` are called withouth a `!row_factory`
+    `~psycopg.Connection.cursor()` are called without a `!row_factory`
     parameter.
 
     """
index 520a71d72bbb12eba40150be019044ecfbb813b5..2f1a02ac4262bd2f2d00273075922448222eef74 100644 (file)
@@ -21,7 +21,7 @@ def quote(obj: Any, context: Optional[AdaptContext] = None) -> str:
 
     Use this function only if you absolutely want to convert a Python string to
     an SQL quoted literal to use e.g. to generate batch SQL and you won't have
-    a connection avaliable when you will need to use it.
+    a connection available when you will need to use it.
 
     This function is relatively inefficient, because it doesn't cache the
     adaptation rules. If you pass a *context* you can adapt the adaptation
index e636862a7518ad90282cfcb3e5227074869173db..e1e2c73b36326a107ba6759e1999c605f17c0533 100644 (file)
@@ -470,12 +470,12 @@ _re_range = re.compile(
     (?:                         # lower bound:
       " ( (?: [^"] | "")* ) "   #   - a quoted string
       | ( [^",]+ )              #   - or an unquoted string
-    )?                          #   - or empty (not catched)
+    )?                          #   - or empty (not caught)
     ,
     (?:                         # upper bound:
       " ( (?: [^"] | "")* ) "   #   - a quoted string
       | ( [^"\)\]]+ )           #   - or an unquoted string
-    )?                          #   - or empty (not catched)
+    )?                          #   - or empty (not caught)
     ( \)|\] )                   # upper bound flag
     """,
     re.VERBOSE,
index 2bf5cfe8f32e8fcdeac9e8e4e1704d5af4df8ce0..f389e43c0ba6d5fb8e0973093cbe777383dbcec1 100644 (file)
@@ -55,7 +55,7 @@ class StrDumper(_StrDumper):
     """
     Dumper for strings in text format to the text oid.
 
-    Note that this dumper is not used by deafult because the type is too strict
+    Note that this dumper is not used by default because the type is too strict
     and PostgreSQL would require an explicit casts to everything that is not a
     text field. However it is useful where the unknown oid is ambiguous and the
     text oid is required, for instance with variadic functions.
index 0ab9b0a021da3b65c02377833af863f04190da9a..5676fef258f8301d0cea456c3468480ee05667ad 100644 (file)
@@ -55,7 +55,7 @@ cdef class CDumper:
         The function interface allows C code to use this method automatically
         to create larger buffers, e.g. for copy, composite objects, etc.
 
-        Implementation note: as you will alway need to make sure that rv
+        Implementation note: as you will always need to make sure that rv
         has enough space to include what you want to dump, `ensure_size()`
         might probably come handy.
         """
index 3921f20ff161b21a3231eab0a27bff0e8e76a439..c96dd3b265f8f26015e96b30fdf655652f90425e 100644 (file)
@@ -672,7 +672,7 @@ cdef (Py_ssize_t, libpq.Oid *, char * const*, int *, int *) _query_params_args(
 ) except *:
     cdef int i
 
-    # the PostgresQuery convers the param_types to tuple, so this operation
+    # the PostgresQuery converts the param_types to tuple, so this operation
     # is most often no-op
     cdef tuple tparam_types
     if param_types is not None and not isinstance(param_types, tuple):
index cff136bb428d26da77c963796791cc1cf238b290..53fd30b1bb91318290a8d14cc470a080b71067b3 100644 (file)
@@ -157,7 +157,7 @@ cdef class BytesDumper(CDumper):
     format = PQ_TEXT
     oid = oids.BYTEA_OID
 
-    # 0: not set, 1: just  single "'" quote, 3: " E'" qoute
+    # 0: not set, 1: just  single "'" quote, 3: " E'" quote
     cdef int _qplen
 
     def __cinit__(self):
index 62e1b3f859adab2fe6f91ec67f5efef2c58762b4..436485d7e8f381f464d4245f956ceb1894631b8b 100644 (file)
@@ -96,7 +96,7 @@ class NullConnectionPool(_BaseNullConnectionPool, ConnectionPool):
         elif self.max_waiting and len(self._waiting) >= self.max_waiting:
             self._stats[self._REQUESTS_ERRORS] += 1
             raise TooManyRequests(
-                f"the pool {self.name!r} has aleady"
+                f"the pool {self.name!r} has already"
                 f" {len(self._waiting)} requests waiting"
             )
         return conn
@@ -158,6 +158,6 @@ class NullConnectionPool(_BaseNullConnectionPool, ConnectionPool):
                 if self._pool_full_event:
                     self._pool_full_event.set()
                 else:
-                    # The connection created by wait shoudn't decrease the
+                    # The connection created by wait shouldn't decrease the
                     # count of the number of connection used.
                     self._nconns -= 1
index 694e8f0912e5bac1269108d360a5f737a1781486..3fa8a146240e7e78858ecd1ca8df77d112767103 100644 (file)
@@ -57,7 +57,7 @@ class AsyncNullConnectionPool(_BaseNullConnectionPool, AsyncConnectionPool):
         elif self.max_waiting and len(self._waiting) >= self.max_waiting:
             self._stats[self._REQUESTS_ERRORS] += 1
             raise TooManyRequests(
-                f"the pool {self.name!r} has aleady"
+                f"the pool {self.name!r} has already"
                 f" {len(self._waiting)} requests waiting"
             )
         return conn
@@ -121,6 +121,6 @@ class AsyncNullConnectionPool(_BaseNullConnectionPool, AsyncConnectionPool):
                 if self._pool_full_event:
                     self._pool_full_event.set()
                 else:
-                    # The connection created by wait shoudn't decrease the
+                    # The connection created by wait shouldn't decrease the
                     # count of the number of connection used.
                     self._nconns -= 1
index c9f7c0c7a1d45d9a61cbf20e8c8e3fd562d19982..664ca123f318418112095c405b469855d786f978 100644 (file)
@@ -128,7 +128,7 @@ class ConnectionPool(BasePool[Connection[Any]]):
     def getconn(self, timeout: Optional[float] = None) -> Connection[Any]:
         """Obtain a connection from the pool.
 
-        You should preferrably use `connection()`. Use this function only if
+        You should preferably use `connection()`. Use this function only if
         it is not possible to use the connection as context manager.
 
         After using this function you *must* call a corresponding `putconn()`:
@@ -187,7 +187,7 @@ class ConnectionPool(BasePool[Connection[Any]]):
         elif self.max_waiting and len(self._waiting) >= self.max_waiting:
             self._stats[self._REQUESTS_ERRORS] += 1
             raise TooManyRequests(
-                f"the pool {self.name!r} has aleady"
+                f"the pool {self.name!r} has already"
                 f" {len(self._waiting)} requests waiting"
             )
         return conn
@@ -447,7 +447,7 @@ class ConnectionPool(BasePool[Connection[Any]]):
         # Don't make all the workers time out at the same moment
         timeout = cls._jitter(cls._WORKER_TIMEOUT, -0.1, 0.1)
         while True:
-            # Use a timeout to make the wait interruptable
+            # Use a timeout to make the wait interruptible
             try:
                 task = q.get(timeout=timeout)
             except Empty:
index e9bb2adc4310e7689f7d2db58c9028439bbe4167..bb7be930ad6089026b673e909184f95a6cd6e95c 100644 (file)
@@ -153,7 +153,7 @@ class AsyncConnectionPool(BasePool[AsyncConnection[Any]]):
         elif self.max_waiting and len(self._waiting) >= self.max_waiting:
             self._stats[self._REQUESTS_ERRORS] += 1
             raise TooManyRequests(
-                f"the pool {self.name!r} has aleady"
+                f"the pool {self.name!r} has already"
                 f" {len(self._waiting)} requests waiting"
             )
         return conn
index db26d4de573651c998a43456a91ecf22aac7fea5..aebd553e5f94f30d0d68c0d58b01e24bb1c6a399 100644 (file)
@@ -143,7 +143,7 @@ class Faker:
 
     @contextmanager
     def find_insert_problem(self, conn):
-        """Context manager to help finding a problematic vaule."""
+        """Context manager to help finding a problematic value."""
         try:
             yield
         except psycopg.DatabaseError:
index b2b5e0fb9b639c9d1586b5123e39eb8811ecaf1c..7db3b1dbad82fd3de623a6958b86ef4af9689ec2 100644 (file)
@@ -409,7 +409,7 @@ def test_named_savepoints_successful_exit(conn, commands):
     ...and exiting the context successfully will "commit" the same.
     """
     # Case 1
-    # Using Transaction explicitly becase conn.transaction() enters the contetx
+    # Using Transaction explicitly because conn.transaction() enters the contetx
     assert not commands
     with conn.transaction() as tx:
         assert commands.popall() == ["BEGIN"]
index 4335eb837d764d80d6470ab9c270286d75014c2d..51bc023ddbbb29af4a5e1c9132614cab96416872 100644 (file)
@@ -362,7 +362,7 @@ async def test_named_savepoints_successful_exit(aconn, acommands):
     commands = acommands
 
     # Case 1
-    # Using Transaction explicitly becase conn.transaction() enters the contetx
+    # Using Transaction explicitly because conn.transaction() enters the contetx
     async with aconn.transaction() as tx:
         assert commands.popall() == ["BEGIN"]
         assert not tx.savepoint_name