Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-psycopg for openSUSE:Factory checked in at 2024-03-22 15:20:25 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-psycopg (Old) and /work/SRC/openSUSE:Factory/.python-psycopg.new.1905 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-psycopg" Fri Mar 22 15:20:25 2024 rev:4 rq:1160438 version:3.1.18 Changes: -------- --- /work/SRC/openSUSE:Factory/python-psycopg/python-psycopg.changes 2024-01-15 22:16:58.881896973 +0100 +++ /work/SRC/openSUSE:Factory/.python-psycopg.new.1905/python-psycopg.changes 2024-03-22 15:32:26.071000919 +0100 @@ -1,0 +2,9 @@ +Thu Mar 21 17:15:28 UTC 2024 - Dirk Müller <[email protected]> + +- update to 3.1.18: + * Fix possible deadlock on pipeline exit (:ticket:`#685`). + * Fix overflow loading large intervals in C module + * Fix compatibility with musl libc distributions affected by + CPython issue #65821 + +------------------------------------------------------------------- Old: ---- psycopg-3.1.17.tar.gz New: ---- psycopg-3.1.18.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-psycopg.spec ++++++ --- /var/tmp/diff_new_pack.3qDzw4/_old 2024-03-22 15:32:26.579019597 +0100 +++ /var/tmp/diff_new_pack.3qDzw4/_new 2024-03-22 15:32:26.583019744 +0100 @@ -19,7 +19,7 @@ %{?sle15_python_module_pythons} Name: python-psycopg # This needs to upgraded in lockstep with python-psycopg-c -Version: 3.1.17 +Version: 3.1.18 Release: 0 Summary: PostgreSQL database adapter for Python License: LGPL-3.0-only ++++++ psycopg-3.1.17.tar.gz -> psycopg-3.1.18.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psycopg-3.1.17/.flake8 new/psycopg-3.1.18/.flake8 --- old/psycopg-3.1.17/.flake8 2024-01-07 02:41:20.000000000 +0100 +++ new/psycopg-3.1.18/.flake8 2024-02-04 18:42:54.000000000 +0100 @@ -1,6 +1,6 @@ [flake8] max-line-length = 88 -ignore = W503, E203 +ignore = W503, E203, E704 extend-exclude = .venv build per-file-ignores = # Autogenerated section diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psycopg-3.1.17/.github/workflows/3rd-party-tests.yml new/psycopg-3.1.18/.github/workflows/3rd-party-tests.yml --- old/psycopg-3.1.17/.github/workflows/3rd-party-tests.yml 2024-01-07 02:41:20.000000000 +0100 +++ new/psycopg-3.1.18/.github/workflows/3rd-party-tests.yml 2024-02-04 18:42:54.000000000 +0100 @@ -61,7 +61,7 @@ --health-retries 5 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: @@ -158,7 +158,7 @@ --health-retries 5 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psycopg-3.1.17/.github/workflows/lint.yml new/psycopg-3.1.18/.github/workflows/lint.yml --- old/psycopg-3.1.17/.github/workflows/lint.yml 2024-01-07 02:41:20.000000000 +0100 +++ new/psycopg-3.1.18/.github/workflows/lint.yml 2024-02-04 18:42:54.000000000 +0100 @@ -18,7 +18,7 @@ if: true steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psycopg-3.1.17/.github/workflows/packages-bin.yml new/psycopg-3.1.18/.github/workflows/packages-bin.yml --- old/psycopg-3.1.17/.github/workflows/packages-bin.yml 2024-01-07 02:41:20.000000000 +0100 +++ new/psycopg-3.1.18/.github/workflows/packages-bin.yml 2024-02-04 18:42:54.000000000 +0100 @@ -23,7 +23,7 @@ platform: [manylinux, musllinux] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up QEMU for multi-arch build # Check https://github.com/docker/setup-qemu-action for newer versions. @@ -43,7 +43,7 @@ run: python3 ./tools/build/copy_to_binary.py - name: Build wheels - uses: pypa/[email protected] + uses: pypa/[email protected] with: package-dir: psycopg_binary env: @@ -71,7 +71,7 @@ PSYCOPG_TEST_WANT_LIBPQ_BUILD=${{ env.LIBPQ_VERSION }} PSYCOPG_TEST_WANT_LIBPQ_IMPORT=${{ env.LIBPQ_VERSION }} - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@v3 with: path: ./wheelhouse/*.whl @@ -104,13 +104,13 @@ pyver: [cp37, cp38, cp39, cp310, cp311, cp312] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Create the binary package source tree run: python3 ./tools/build/copy_to_binary.py - name: Build wheels - uses: pypa/[email protected] + uses: pypa/[email protected] with: package-dir: psycopg_binary env: @@ -128,7 +128,7 @@ PSYCOPG_TEST_WANT_LIBPQ_BUILD=">= $PG_VERSION" PSYCOPG_TEST_WANT_LIBPQ_IMPORT=">= $PG_VERSION" - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@v3 with: path: ./wheelhouse/*.whl @@ -147,7 +147,7 @@ pyver: [cp37, cp38, cp39, cp310, cp311, cp312] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Start PostgreSQL service for test run: | @@ -159,7 +159,7 @@ run: python3 ./tools/build/copy_to_binary.py - name: Build wheels - uses: pypa/[email protected] + uses: pypa/[email protected] with: package-dir: psycopg_binary env: @@ -179,7 +179,7 @@ PSYCOPG_TEST_WANT_LIBPQ_BUILD=">= 14" PSYCOPG_TEST_WANT_LIBPQ_IMPORT=">= 14" - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@v3 with: path: ./wheelhouse/*.whl diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psycopg-3.1.17/.github/workflows/packages-pool.yml new/psycopg-3.1.18/.github/workflows/packages-pool.yml --- old/psycopg-3.1.17/.github/workflows/packages-pool.yml 2024-01-07 02:41:20.000000000 +0100 +++ new/psycopg-3.1.18/.github/workflows/packages-pool.yml 2024-02-04 18:42:54.000000000 +0100 @@ -18,7 +18,7 @@ - {package: psycopg_pool, format: wheel} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: @@ -39,7 +39,7 @@ PSYCOPG_TEST_DSN: "host=127.0.0.1 user=postgres" PGPASSWORD: password - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@v3 with: path: ./dist/* diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psycopg-3.1.17/.github/workflows/packages-src.yml new/psycopg-3.1.18/.github/workflows/packages-src.yml --- old/psycopg-3.1.17/.github/workflows/packages-src.yml 2024-01-07 02:41:20.000000000 +0100 +++ new/psycopg-3.1.18/.github/workflows/packages-src.yml 2024-02-04 18:42:54.000000000 +0100 @@ -20,7 +20,7 @@ - {package: psycopg_c, format: sdist, impl: c} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: @@ -47,7 +47,7 @@ PSYCOPG_TEST_DSN: "host=127.0.0.1 user=postgres" PGPASSWORD: password - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@v3 with: path: ./dist/* diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psycopg-3.1.17/.github/workflows/tests.yml new/psycopg-3.1.18/.github/workflows/tests.yml --- old/psycopg-3.1.17/.github/workflows/tests.yml 2024-01-07 02:41:20.000000000 +0100 +++ new/psycopg-3.1.18/.github/workflows/tests.yml 2024-02-04 18:42:54.000000000 +0100 @@ -59,7 +59,7 @@ MARKERS: "" steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: @@ -152,7 +152,7 @@ NOT_MARKERS: "timing proxy mypy" steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: @@ -211,7 +211,7 @@ shell: bash steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: @@ -266,7 +266,7 @@ PSYCOPG_TEST_DSN: "host=127.0.0.1 port=26257 user=root dbname=defaultdb" steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psycopg-3.1.17/docs/news.rst new/psycopg-3.1.18/docs/news.rst --- old/psycopg-3.1.17/docs/news.rst 2024-01-07 02:41:20.000000000 +0100 +++ new/psycopg-3.1.18/docs/news.rst 2024-02-04 18:42:54.000000000 +0100 @@ -10,13 +10,24 @@ Current release --------------- +Psycopg 3.1.18 +^^^^^^^^^^^^^^ + +- Fix possible deadlock on pipeline exit (:ticket:`#685`). +- Fix overflow loading large intervals in C module (:ticket:`#719`). +- Fix compatibility with musl libc distributions affected by `CPython issue + #65821`__ (:ticket:`#725`). + +.. __: https://github.com/python/cpython/issues/65821 + + Psycopg 3.1.17 ^^^^^^^^^^^^^^ - Fix multiple connection attempts when a host name resolve to multiple - IP addresses (:ticket:`699`). + IP addresses (:ticket:`#699`). - Use `typing.Self` as a more correct return value annotation of context - managers and other self-returning methods (see :ticket:`708`). + managers and other self-returning methods (see :ticket:`#708`). Psycopg 3.1.16 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psycopg-3.1.17/psycopg/.flake8 new/psycopg-3.1.18/psycopg/.flake8 --- old/psycopg-3.1.17/psycopg/.flake8 2024-01-07 02:41:20.000000000 +0100 +++ new/psycopg-3.1.18/psycopg/.flake8 2024-02-04 18:42:54.000000000 +0100 @@ -1,6 +1,6 @@ [flake8] max-line-length = 88 -ignore = W503, E203 +ignore = W503, E203, E704 per-file-ignores = # Autogenerated section psycopg/errors.py: E125, E128, E302 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psycopg-3.1.17/psycopg/psycopg/_pipeline.py new/psycopg-3.1.18/psycopg/psycopg/_pipeline.py --- old/psycopg-3.1.17/psycopg/psycopg/_pipeline.py 2024-01-07 02:41:20.000000000 +0100 +++ new/psycopg-3.1.18/psycopg/psycopg/_pipeline.py 2024-02-04 18:42:54.000000000 +0100 @@ -132,8 +132,7 @@ self._enqueue_sync() yield from self._communicate_gen() finally: - # No need to force flush since we emitted a sync just before. - yield from self._fetch_gen(flush=False) + yield from self._fetch_gen(flush=True) def _communicate_gen(self) -> PQGen[None]: """Communicate with pipeline to send commands and possibly fetch diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psycopg-3.1.17/psycopg/psycopg/_struct.py new/psycopg-3.1.18/psycopg/psycopg/_struct.py --- old/psycopg-3.1.17/psycopg/psycopg/_struct.py 2024-01-07 02:41:20.000000000 +0100 +++ new/psycopg-3.1.18/psycopg/psycopg/_struct.py 2024-02-04 18:42:54.000000000 +0100 @@ -19,8 +19,7 @@ class UnpackLen(Protocol): - def __call__(self, data: Buffer, start: Optional[int]) -> Tuple[int]: - ... + def __call__(self, data: Buffer, start: Optional[int]) -> Tuple[int]: ... pack_int2 = cast(PackInt, struct.Struct("!h").pack) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psycopg-3.1.17/psycopg/psycopg/_typeinfo.py new/psycopg-3.1.18/psycopg/psycopg/_typeinfo.py --- old/psycopg-3.1.17/psycopg/psycopg/_typeinfo.py 2024-01-07 02:41:20.000000000 +0100 +++ new/psycopg-3.1.18/psycopg/psycopg/_typeinfo.py 2024-02-04 18:42:54.000000000 +0100 @@ -57,15 +57,13 @@ @classmethod def fetch( cls: Type[T], conn: "Connection[Any]", name: Union[str, "Identifier"] - ) -> Optional[T]: - ... + ) -> Optional[T]: ... @overload @classmethod async def fetch( cls: Type[T], conn: "AsyncConnection[Any]", name: Union[str, "Identifier"] - ) -> Optional[T]: - ... + ) -> Optional[T]: ... @classmethod def fetch( @@ -414,12 +412,10 @@ yield t @overload - def __getitem__(self, key: Union[str, int]) -> TypeInfo: - ... + def __getitem__(self, key: Union[str, int]) -> TypeInfo: ... @overload - def __getitem__(self, key: Tuple[Type[T], int]) -> T: - ... + def __getitem__(self, key: Tuple[Type[T], int]) -> T: ... def __getitem__(self, key: RegistryKey) -> TypeInfo: """ @@ -440,12 +436,10 @@ raise KeyError(f"couldn't find the type {key!r} in the types registry") @overload - def get(self, key: Union[str, int]) -> Optional[TypeInfo]: - ... + def get(self, key: Union[str, int]) -> Optional[TypeInfo]: ... @overload - def get(self, key: Tuple[Type[T], int]) -> Optional[T]: - ... + def get(self, key: Tuple[Type[T], int]) -> Optional[T]: ... def get(self, key: RegistryKey) -> Optional[TypeInfo]: """ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psycopg-3.1.17/psycopg/psycopg/abc.py new/psycopg-3.1.18/psycopg/psycopg/abc.py --- old/psycopg-3.1.17/psycopg/psycopg/abc.py 2024-01-07 02:41:20.000000000 +0100 +++ new/psycopg-3.1.18/psycopg/psycopg/abc.py 2024-02-04 18:42:54.000000000 +0100 @@ -54,8 +54,7 @@ def __call__( self, gen: PQGen[RV], fileno: int, timeout: Optional[float] = None - ) -> RV: - ... + ) -> RV: ... # Adaptation types @@ -106,8 +105,7 @@ oid: int """The oid to pass to the server, if known; 0 otherwise (class attribute).""" - def __init__(self, cls: type, context: Optional[AdaptContext] = None): - ... + def __init__(self, cls: type, context: Optional[AdaptContext] = None): ... def dump(self, obj: Any) -> Buffer: """Convert the object `!obj` to PostgreSQL representation. @@ -187,8 +185,7 @@ This is a class attribute. """ - def __init__(self, oid: int, context: Optional[AdaptContext] = None): - ... + def __init__(self, oid: int, context: Optional[AdaptContext] = None): ... def load(self, data: Buffer) -> Any: """ @@ -203,28 +200,22 @@ types: Optional[Tuple[int, ...]] formats: Optional[List[pq.Format]] - def __init__(self, context: Optional[AdaptContext] = None): - ... + def __init__(self, context: Optional[AdaptContext] = None): ... @classmethod - def from_context(cls, context: Optional[AdaptContext]) -> "Transformer": - ... + def from_context(cls, context: Optional[AdaptContext]) -> "Transformer": ... @property - def connection(self) -> Optional["BaseConnection[Any]"]: - ... + def connection(self) -> Optional["BaseConnection[Any]"]: ... @property - def encoding(self) -> str: - ... + def encoding(self) -> str: ... @property - def adapters(self) -> "AdaptersMap": - ... + def adapters(self) -> "AdaptersMap": ... @property - def pgresult(self) -> Optional["PGresult"]: - ... + def pgresult(self) -> Optional["PGresult"]: ... def set_pgresult( self, @@ -232,34 +223,26 @@ *, set_loaders: bool = True, format: Optional[pq.Format] = None - ) -> None: - ... + ) -> None: ... - def set_dumper_types(self, types: Sequence[int], format: pq.Format) -> None: - ... + def set_dumper_types(self, types: Sequence[int], format: pq.Format) -> None: ... - def set_loader_types(self, types: Sequence[int], format: pq.Format) -> None: - ... + def set_loader_types(self, types: Sequence[int], format: pq.Format) -> None: ... def dump_sequence( self, params: Sequence[Any], formats: Sequence[PyFormat] - ) -> Sequence[Optional[Buffer]]: - ... + ) -> Sequence[Optional[Buffer]]: ... - def as_literal(self, obj: Any) -> bytes: - ... + def as_literal(self, obj: Any) -> bytes: ... - def get_dumper(self, obj: Any, format: PyFormat) -> Dumper: - ... + def get_dumper(self, obj: Any, format: PyFormat) -> Dumper: ... - def load_rows(self, row0: int, row1: int, make_row: "RowMaker[Row]") -> List["Row"]: - ... + def load_rows( + self, row0: int, row1: int, make_row: "RowMaker[Row]" + ) -> List["Row"]: ... - def load_row(self, row: int, make_row: "RowMaker[Row]") -> Optional["Row"]: - ... + def load_row(self, row: int, make_row: "RowMaker[Row]") -> Optional["Row"]: ... - def load_sequence(self, record: Sequence[Optional[Buffer]]) -> Tuple[Any, ...]: - ... + def load_sequence(self, record: Sequence[Optional[Buffer]]) -> Tuple[Any, ...]: ... - def get_loader(self, oid: int, format: pq.Format) -> Loader: - ... + def get_loader(self, oid: int, format: pq.Format) -> Loader: ... diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psycopg-3.1.17/psycopg/psycopg/adapt.py new/psycopg-3.1.18/psycopg/psycopg/adapt.py --- old/psycopg-3.1.17/psycopg/psycopg/adapt.py 2024-01-07 02:41:20.000000000 +0100 +++ new/psycopg-3.1.18/psycopg/psycopg/adapt.py 2024-02-04 18:42:54.000000000 +0100 @@ -45,8 +45,7 @@ ) @abstractmethod - def dump(self, obj: Any) -> Buffer: - ... + def dump(self, obj: Any) -> Buffer: ... def quote(self, obj: Any) -> Buffer: """ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psycopg-3.1.17/psycopg/psycopg/connection.py new/psycopg-3.1.18/psycopg/psycopg/connection.py --- old/psycopg-3.1.17/psycopg/psycopg/connection.py 2024-01-07 02:41:20.000000000 +0100 +++ new/psycopg-3.1.18/psycopg/psycopg/connection.py 2024-02-04 18:42:54.000000000 +0100 @@ -705,8 +705,7 @@ cursor_factory: Optional[Type[Cursor[Any]]] = None, context: Optional[AdaptContext] = None, **kwargs: Union[None, int, str], - ) -> "Connection[TupleRow]": - ... + ) -> "Connection[TupleRow]": ... @classmethod # type: ignore[misc] # https://github.com/python/mypy/issues/11004 def connect( @@ -810,14 +809,12 @@ self.pgconn.finish() @overload - def cursor(self, *, binary: bool = False) -> Cursor[Row]: - ... + def cursor(self, *, binary: bool = False) -> Cursor[Row]: ... @overload def cursor( self, *, binary: bool = False, row_factory: RowFactory[CursorRow] - ) -> Cursor[CursorRow]: - ... + ) -> Cursor[CursorRow]: ... @overload def cursor( @@ -827,8 +824,7 @@ binary: bool = False, scrollable: Optional[bool] = None, withhold: bool = False, - ) -> ServerCursor[Row]: - ... + ) -> ServerCursor[Row]: ... @overload def cursor( @@ -839,8 +835,7 @@ row_factory: RowFactory[CursorRow], scrollable: Optional[bool] = None, withhold: bool = False, - ) -> ServerCursor[CursorRow]: - ... + ) -> ServerCursor[CursorRow]: ... def cursor( self, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psycopg-3.1.17/psycopg/psycopg/connection_async.py new/psycopg-3.1.18/psycopg/psycopg/connection_async.py --- old/psycopg-3.1.17/psycopg/psycopg/connection_async.py 2024-01-07 02:41:20.000000000 +0100 +++ new/psycopg-3.1.18/psycopg/psycopg/connection_async.py 2024-02-04 18:42:54.000000000 +0100 @@ -95,8 +95,7 @@ cursor_factory: Optional[Type[AsyncCursor[Any]]] = None, context: Optional[AdaptContext] = None, **kwargs: Union[None, int, str], - ) -> "AsyncConnection[TupleRow]": - ... + ) -> "AsyncConnection[TupleRow]": ... @classmethod # type: ignore[misc] # https://github.com/python/mypy/issues/11004 async def connect( @@ -200,14 +199,12 @@ self.pgconn.finish() @overload - def cursor(self, *, binary: bool = False) -> AsyncCursor[Row]: - ... + def cursor(self, *, binary: bool = False) -> AsyncCursor[Row]: ... @overload def cursor( self, *, binary: bool = False, row_factory: AsyncRowFactory[CursorRow] - ) -> AsyncCursor[CursorRow]: - ... + ) -> AsyncCursor[CursorRow]: ... @overload def cursor( @@ -217,8 +214,7 @@ binary: bool = False, scrollable: Optional[bool] = None, withhold: bool = False, - ) -> AsyncServerCursor[Row]: - ... + ) -> AsyncServerCursor[Row]: ... @overload def cursor( @@ -229,8 +225,7 @@ row_factory: AsyncRowFactory[CursorRow], scrollable: Optional[bool] = None, withhold: bool = False, - ) -> AsyncServerCursor[CursorRow]: - ... + ) -> AsyncServerCursor[CursorRow]: ... def cursor( self, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psycopg-3.1.17/psycopg/psycopg/copy.py new/psycopg-3.1.18/psycopg/psycopg/copy.py --- old/psycopg-3.1.17/psycopg/psycopg/copy.py 2024-01-07 02:41:20.000000000 +0100 +++ new/psycopg-3.1.18/psycopg/psycopg/copy.py 2024-02-04 18:42:54.000000000 +0100 @@ -552,8 +552,7 @@ """ @abstractmethod - async def write(self, data: Buffer) -> None: - ... + async def write(self, data: Buffer) -> None: ... async def finish(self, exc: Optional[BaseException] = None) -> None: pass @@ -667,20 +666,16 @@ self._row_mode = False # true if the user is using write_row() @abstractmethod - def parse_row(self, data: Buffer) -> Optional[Tuple[Any, ...]]: - ... + def parse_row(self, data: Buffer) -> Optional[Tuple[Any, ...]]: ... @abstractmethod - def write(self, buffer: Union[Buffer, str]) -> Buffer: - ... + def write(self, buffer: Union[Buffer, str]) -> Buffer: ... @abstractmethod - def write_row(self, row: Sequence[Any]) -> Buffer: - ... + def write_row(self, row: Sequence[Any]) -> Buffer: ... @abstractmethod - def end(self) -> Buffer: - ... + def end(self) -> Buffer: ... class TextFormatter(Formatter): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psycopg-3.1.17/psycopg/psycopg/crdb/connection.py new/psycopg-3.1.18/psycopg/psycopg/crdb/connection.py --- old/psycopg-3.1.17/psycopg/psycopg/crdb/connection.py 2024-01-07 02:41:20.000000000 +0100 +++ new/psycopg-3.1.18/psycopg/psycopg/crdb/connection.py 2024-02-04 18:42:54.000000000 +0100 @@ -78,8 +78,7 @@ cursor_factory: "Optional[Type[Cursor[Row]]]" = None, context: Optional[AdaptContext] = None, **kwargs: Union[None, int, str], - ) -> "CrdbConnection[Row]": - ... + ) -> "CrdbConnection[Row]": ... @overload @classmethod @@ -92,8 +91,7 @@ cursor_factory: "Optional[Type[Cursor[Any]]]" = None, context: Optional[AdaptContext] = None, **kwargs: Union[None, int, str], - ) -> "CrdbConnection[TupleRow]": - ... + ) -> "CrdbConnection[TupleRow]": ... @classmethod def connect(cls, conninfo: str = "", **kwargs: Any) -> Self: @@ -125,8 +123,7 @@ cursor_factory: "Optional[Type[AsyncCursor[Row]]]" = None, context: Optional[AdaptContext] = None, **kwargs: Union[None, int, str], - ) -> "AsyncCrdbConnection[Row]": - ... + ) -> "AsyncCrdbConnection[Row]": ... @overload @classmethod @@ -139,8 +136,7 @@ cursor_factory: "Optional[Type[AsyncCursor[Any]]]" = None, context: Optional[AdaptContext] = None, **kwargs: Union[None, int, str], - ) -> "AsyncCrdbConnection[TupleRow]": - ... + ) -> "AsyncCrdbConnection[TupleRow]": ... @classmethod async def connect(cls, conninfo: str = "", **kwargs: Any) -> Self: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psycopg-3.1.17/psycopg/psycopg/cursor.py new/psycopg-3.1.18/psycopg/psycopg/cursor.py --- old/psycopg-3.1.17/psycopg/psycopg/cursor.py 2024-01-07 02:41:20.000000000 +0100 +++ new/psycopg-3.1.18/psycopg/psycopg/cursor.py 2024-02-04 18:42:54.000000000 +0100 @@ -665,12 +665,12 @@ __slots__ = () @overload - def __init__(self, connection: "Connection[Row]"): - ... + def __init__(self, connection: "Connection[Row]"): ... @overload - def __init__(self, connection: "Connection[Any]", *, row_factory: RowFactory[Row]): - ... + def __init__( + self, connection: "Connection[Any]", *, row_factory: RowFactory[Row] + ): ... def __init__( self, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psycopg-3.1.17/psycopg/psycopg/cursor_async.py new/psycopg-3.1.18/psycopg/psycopg/cursor_async.py --- old/psycopg-3.1.17/psycopg/psycopg/cursor_async.py 2024-01-07 02:41:20.000000000 +0100 +++ new/psycopg-3.1.18/psycopg/psycopg/cursor_async.py 2024-02-04 18:42:54.000000000 +0100 @@ -29,14 +29,12 @@ __slots__ = () @overload - def __init__(self, connection: "AsyncConnection[Row]"): - ... + def __init__(self, connection: "AsyncConnection[Row]"): ... @overload def __init__( self, connection: "AsyncConnection[Any]", *, row_factory: AsyncRowFactory[Row] - ): - ... + ): ... def __init__( self, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psycopg-3.1.17/psycopg/psycopg/pq/_pq_ctypes.py new/psycopg-3.1.18/psycopg/psycopg/pq/_pq_ctypes.py --- old/psycopg-3.1.17/psycopg/psycopg/pq/_pq_ctypes.py 2024-01-07 02:41:20.000000000 +0100 +++ new/psycopg-3.1.18/psycopg/psycopg/pq/_pq_ctypes.py 2024-02-04 18:42:54.000000000 +0100 @@ -29,7 +29,10 @@ if sys.platform == "linux": libcname = ctypes.util.find_library("c") - assert libcname + if not libcname: + # Likely this is a system using musl libc, see the following bug: + # https://github.com/python/cpython/issues/65821 + libcname = "libc.so" libc = ctypes.cdll.LoadLibrary(libcname) fdopen = libc.fdopen diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psycopg-3.1.17/psycopg/psycopg/pq/abc.py new/psycopg-3.1.18/psycopg/psycopg/pq/abc.py --- old/psycopg-3.1.17/psycopg/psycopg/pq/abc.py 2024-01-07 02:41:20.000000000 +0100 +++ new/psycopg-3.1.18/psycopg/psycopg/pq/abc.py 2024-02-04 18:42:54.000000000 +0100 @@ -23,112 +23,83 @@ notify_handler: Optional[Callable[["PGnotify"], None]] @classmethod - def connect(cls, conninfo: bytes) -> "PGconn": - ... + def connect(cls, conninfo: bytes) -> "PGconn": ... @classmethod - def connect_start(cls, conninfo: bytes) -> "PGconn": - ... + def connect_start(cls, conninfo: bytes) -> "PGconn": ... - def connect_poll(self) -> int: - ... + def connect_poll(self) -> int: ... - def finish(self) -> None: - ... + def finish(self) -> None: ... @property - def info(self) -> List["ConninfoOption"]: - ... + def info(self) -> List["ConninfoOption"]: ... - def reset(self) -> None: - ... + def reset(self) -> None: ... - def reset_start(self) -> None: - ... + def reset_start(self) -> None: ... - def reset_poll(self) -> int: - ... + def reset_poll(self) -> int: ... @classmethod - def ping(self, conninfo: bytes) -> int: - ... + def ping(self, conninfo: bytes) -> int: ... @property - def db(self) -> bytes: - ... + def db(self) -> bytes: ... @property - def user(self) -> bytes: - ... + def user(self) -> bytes: ... @property - def password(self) -> bytes: - ... + def password(self) -> bytes: ... @property - def host(self) -> bytes: - ... + def host(self) -> bytes: ... @property - def hostaddr(self) -> bytes: - ... + def hostaddr(self) -> bytes: ... @property - def port(self) -> bytes: - ... + def port(self) -> bytes: ... @property - def tty(self) -> bytes: - ... + def tty(self) -> bytes: ... @property - def options(self) -> bytes: - ... + def options(self) -> bytes: ... @property - def status(self) -> int: - ... + def status(self) -> int: ... @property - def transaction_status(self) -> int: - ... + def transaction_status(self) -> int: ... - def parameter_status(self, name: bytes) -> Optional[bytes]: - ... + def parameter_status(self, name: bytes) -> Optional[bytes]: ... @property - def error_message(self) -> bytes: - ... + def error_message(self) -> bytes: ... @property - def server_version(self) -> int: - ... + def server_version(self) -> int: ... @property - def socket(self) -> int: - ... + def socket(self) -> int: ... @property - def backend_pid(self) -> int: - ... + def backend_pid(self) -> int: ... @property - def needs_password(self) -> bool: - ... + def needs_password(self) -> bool: ... @property - def used_password(self) -> bool: - ... + def used_password(self) -> bool: ... @property - def ssl_in_use(self) -> bool: - ... + def ssl_in_use(self) -> bool: ... - def exec_(self, command: bytes) -> "PGresult": - ... + def exec_(self, command: bytes) -> "PGresult": ... - def send_query(self, command: bytes) -> None: - ... + def send_query(self, command: bytes) -> None: ... def exec_params( self, @@ -137,8 +108,7 @@ param_types: Optional[Sequence[int]] = None, param_formats: Optional[Sequence[int]] = None, result_format: int = Format.TEXT, - ) -> "PGresult": - ... + ) -> "PGresult": ... def send_query_params( self, @@ -147,16 +117,14 @@ param_types: Optional[Sequence[int]] = None, param_formats: Optional[Sequence[int]] = None, result_format: int = Format.TEXT, - ) -> None: - ... + ) -> None: ... def send_prepare( self, name: bytes, command: bytes, param_types: Optional[Sequence[int]] = None, - ) -> None: - ... + ) -> None: ... def send_query_prepared( self, @@ -164,16 +132,14 @@ param_values: Optional[Sequence[Optional[Buffer]]], param_formats: Optional[Sequence[int]] = None, result_format: int = Format.TEXT, - ) -> None: - ... + ) -> None: ... def prepare( self, name: bytes, command: bytes, param_types: Optional[Sequence[int]] = None, - ) -> "PGresult": - ... + ) -> "PGresult": ... def exec_prepared( self, @@ -181,204 +147,145 @@ param_values: Optional[Sequence[Buffer]], param_formats: Optional[Sequence[int]] = None, result_format: int = 0, - ) -> "PGresult": - ... + ) -> "PGresult": ... - def describe_prepared(self, name: bytes) -> "PGresult": - ... + def describe_prepared(self, name: bytes) -> "PGresult": ... - def send_describe_prepared(self, name: bytes) -> None: - ... + def send_describe_prepared(self, name: bytes) -> None: ... - def describe_portal(self, name: bytes) -> "PGresult": - ... + def describe_portal(self, name: bytes) -> "PGresult": ... - def send_describe_portal(self, name: bytes) -> None: - ... + def send_describe_portal(self, name: bytes) -> None: ... - def get_result(self) -> Optional["PGresult"]: - ... + def get_result(self) -> Optional["PGresult"]: ... - def consume_input(self) -> None: - ... + def consume_input(self) -> None: ... - def is_busy(self) -> int: - ... + def is_busy(self) -> int: ... @property - def nonblocking(self) -> int: - ... + def nonblocking(self) -> int: ... @nonblocking.setter - def nonblocking(self, arg: int) -> None: - ... + def nonblocking(self, arg: int) -> None: ... - def flush(self) -> int: - ... + def flush(self) -> int: ... - def set_single_row_mode(self) -> None: - ... + def set_single_row_mode(self) -> None: ... - def get_cancel(self) -> "PGcancel": - ... + def get_cancel(self) -> "PGcancel": ... - def notifies(self) -> Optional["PGnotify"]: - ... + def notifies(self) -> Optional["PGnotify"]: ... - def put_copy_data(self, buffer: Buffer) -> int: - ... + def put_copy_data(self, buffer: Buffer) -> int: ... - def put_copy_end(self, error: Optional[bytes] = None) -> int: - ... + def put_copy_end(self, error: Optional[bytes] = None) -> int: ... - def get_copy_data(self, async_: int) -> Tuple[int, memoryview]: - ... + def get_copy_data(self, async_: int) -> Tuple[int, memoryview]: ... - def trace(self, fileno: int) -> None: - ... + def trace(self, fileno: int) -> None: ... - def set_trace_flags(self, flags: Trace) -> None: - ... + def set_trace_flags(self, flags: Trace) -> None: ... - def untrace(self) -> None: - ... + def untrace(self) -> None: ... def encrypt_password( self, passwd: bytes, user: bytes, algorithm: Optional[bytes] = None - ) -> bytes: - ... + ) -> bytes: ... - def make_empty_result(self, exec_status: int) -> "PGresult": - ... + def make_empty_result(self, exec_status: int) -> "PGresult": ... @property - def pipeline_status(self) -> int: - ... + def pipeline_status(self) -> int: ... - def enter_pipeline_mode(self) -> None: - ... + def enter_pipeline_mode(self) -> None: ... - def exit_pipeline_mode(self) -> None: - ... + def exit_pipeline_mode(self) -> None: ... - def pipeline_sync(self) -> None: - ... + def pipeline_sync(self) -> None: ... - def send_flush_request(self) -> None: - ... + def send_flush_request(self) -> None: ... class PGresult(Protocol): - def clear(self) -> None: - ... + def clear(self) -> None: ... @property - def status(self) -> int: - ... + def status(self) -> int: ... @property - def error_message(self) -> bytes: - ... + def error_message(self) -> bytes: ... - def error_field(self, fieldcode: int) -> Optional[bytes]: - ... + def error_field(self, fieldcode: int) -> Optional[bytes]: ... @property - def ntuples(self) -> int: - ... + def ntuples(self) -> int: ... @property - def nfields(self) -> int: - ... + def nfields(self) -> int: ... - def fname(self, column_number: int) -> Optional[bytes]: - ... + def fname(self, column_number: int) -> Optional[bytes]: ... - def ftable(self, column_number: int) -> int: - ... + def ftable(self, column_number: int) -> int: ... - def ftablecol(self, column_number: int) -> int: - ... + def ftablecol(self, column_number: int) -> int: ... - def fformat(self, column_number: int) -> int: - ... + def fformat(self, column_number: int) -> int: ... - def ftype(self, column_number: int) -> int: - ... + def ftype(self, column_number: int) -> int: ... - def fmod(self, column_number: int) -> int: - ... + def fmod(self, column_number: int) -> int: ... - def fsize(self, column_number: int) -> int: - ... + def fsize(self, column_number: int) -> int: ... @property - def binary_tuples(self) -> int: - ... + def binary_tuples(self) -> int: ... - def get_value(self, row_number: int, column_number: int) -> Optional[bytes]: - ... + def get_value(self, row_number: int, column_number: int) -> Optional[bytes]: ... @property - def nparams(self) -> int: - ... + def nparams(self) -> int: ... - def param_type(self, param_number: int) -> int: - ... + def param_type(self, param_number: int) -> int: ... @property - def command_status(self) -> Optional[bytes]: - ... + def command_status(self) -> Optional[bytes]: ... @property - def command_tuples(self) -> Optional[int]: - ... + def command_tuples(self) -> Optional[int]: ... @property - def oid_value(self) -> int: - ... + def oid_value(self) -> int: ... - def set_attributes(self, descriptions: List["PGresAttDesc"]) -> None: - ... + def set_attributes(self, descriptions: List["PGresAttDesc"]) -> None: ... class PGcancel(Protocol): - def free(self) -> None: - ... + def free(self) -> None: ... - def cancel(self) -> None: - ... + def cancel(self) -> None: ... class Conninfo(Protocol): @classmethod - def get_defaults(cls) -> List["ConninfoOption"]: - ... + def get_defaults(cls) -> List["ConninfoOption"]: ... @classmethod - def parse(cls, conninfo: bytes) -> List["ConninfoOption"]: - ... + def parse(cls, conninfo: bytes) -> List["ConninfoOption"]: ... @classmethod - def _options_from_array(cls, opts: Sequence[Any]) -> List["ConninfoOption"]: - ... + def _options_from_array(cls, opts: Sequence[Any]) -> List["ConninfoOption"]: ... class Escaping(Protocol): - def __init__(self, conn: Optional[PGconn] = None): - ... + def __init__(self, conn: Optional[PGconn] = None): ... - def escape_literal(self, data: Buffer) -> bytes: - ... + def escape_literal(self, data: Buffer) -> bytes: ... - def escape_identifier(self, data: Buffer) -> bytes: - ... + def escape_identifier(self, data: Buffer) -> bytes: ... - def escape_string(self, data: Buffer) -> bytes: - ... + def escape_string(self, data: Buffer) -> bytes: ... - def escape_bytea(self, data: Buffer) -> bytes: - ... + def escape_bytea(self, data: Buffer) -> bytes: ... - def unescape_bytea(self, data: Buffer) -> bytes: - ... + def unescape_bytea(self, data: Buffer) -> bytes: ... diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psycopg-3.1.17/psycopg/psycopg/rows.py new/psycopg-3.1.18/psycopg/psycopg/rows.py --- old/psycopg-3.1.17/psycopg/psycopg/rows.py 2024-01-07 02:41:20.000000000 +0100 +++ new/psycopg-3.1.18/psycopg/psycopg/rows.py 2024-02-04 18:42:54.000000000 +0100 @@ -43,8 +43,7 @@ Typically, `!RowMaker` functions are returned by `RowFactory`. """ - def __call__(self, __values: Sequence[Any]) -> Row: - ... + def __call__(self, __values: Sequence[Any]) -> Row: ... class RowFactory(Protocol[Row]): @@ -61,8 +60,7 @@ use the values to create a dictionary for each record. """ - def __call__(self, __cursor: "Cursor[Any]") -> RowMaker[Row]: - ... + def __call__(self, __cursor: "Cursor[Any]") -> RowMaker[Row]: ... class AsyncRowFactory(Protocol[Row]): @@ -70,8 +68,7 @@ Like `RowFactory`, taking an async cursor as argument. """ - def __call__(self, __cursor: "AsyncCursor[Any]") -> RowMaker[Row]: - ... + def __call__(self, __cursor: "AsyncCursor[Any]") -> RowMaker[Row]: ... class BaseRowFactory(Protocol[Row]): @@ -79,8 +76,7 @@ Like `RowFactory`, taking either type of cursor as argument. """ - def __call__(self, __cursor: "BaseCursor[Any, Any]") -> RowMaker[Row]: - ... + def __call__(self, __cursor: "BaseCursor[Any, Any]") -> RowMaker[Row]: ... TupleRow: TypeAlias = Tuple[Any, ...] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psycopg-3.1.17/psycopg/psycopg/server_cursor.py new/psycopg-3.1.18/psycopg/psycopg/server_cursor.py --- old/psycopg-3.1.17/psycopg/psycopg/server_cursor.py 2024-01-07 02:41:20.000000000 +0100 +++ new/psycopg-3.1.18/psycopg/psycopg/server_cursor.py 2024-02-04 18:42:54.000000000 +0100 @@ -221,8 +221,7 @@ *, scrollable: Optional[bool] = None, withhold: bool = False, - ): - ... + ): ... @overload def __init__( @@ -233,8 +232,7 @@ row_factory: RowFactory[Row], scrollable: Optional[bool] = None, withhold: bool = False, - ): - ... + ): ... def __init__( self, @@ -362,8 +360,7 @@ *, scrollable: Optional[bool] = None, withhold: bool = False, - ): - ... + ): ... @overload def __init__( @@ -374,8 +371,7 @@ row_factory: AsyncRowFactory[Row], scrollable: Optional[bool] = None, withhold: bool = False, - ): - ... + ): ... def __init__( self, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psycopg-3.1.17/psycopg/psycopg/types/enum.py new/psycopg-3.1.18/psycopg/psycopg/types/enum.py --- old/psycopg-3.1.17/psycopg/psycopg/types/enum.py 2024-01-07 02:41:20.000000000 +0100 +++ new/psycopg-3.1.18/psycopg/psycopg/types/enum.py 2024-02-04 18:42:54.000000000 +0100 @@ -1,6 +1,7 @@ """ Adapters for the enum type. """ + from enum import Enum from typing import Dict, Generic, Optional, Mapping, Sequence from typing import Tuple, Type, TypeVar, Union, cast diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psycopg-3.1.17/psycopg/psycopg/types/multirange.py new/psycopg-3.1.18/psycopg/psycopg/types/multirange.py --- old/psycopg-3.1.17/psycopg/psycopg/types/multirange.py 2024-01-07 02:41:20.000000000 +0100 +++ new/psycopg-3.1.18/psycopg/psycopg/types/multirange.py 2024-02-04 18:42:54.000000000 +0100 @@ -46,12 +46,10 @@ return f"{{{', '.join(map(str, self._ranges))}}}" @overload - def __getitem__(self, index: int) -> Range[T]: - ... + def __getitem__(self, index: int) -> Range[T]: ... @overload - def __getitem__(self, index: slice) -> "Multirange[T]": - ... + def __getitem__(self, index: slice) -> "Multirange[T]": ... def __getitem__(self, index: Union[int, slice]) -> "Union[Range[T],Multirange[T]]": if isinstance(index, int): @@ -63,12 +61,10 @@ return len(self._ranges) @overload - def __setitem__(self, index: int, value: Range[T]) -> None: - ... + def __setitem__(self, index: int, value: Range[T]) -> None: ... @overload - def __setitem__(self, index: slice, value: Iterable[Range[T]]) -> None: - ... + def __setitem__(self, index: slice, value: Iterable[Range[T]]) -> None: ... def __setitem__( self, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psycopg-3.1.17/psycopg/psycopg/version.py new/psycopg-3.1.18/psycopg/psycopg/version.py --- old/psycopg-3.1.17/psycopg/psycopg/version.py 2024-01-07 02:41:20.000000000 +0100 +++ new/psycopg-3.1.18/psycopg/psycopg/version.py 2024-02-04 18:42:54.000000000 +0100 @@ -8,7 +8,7 @@ # https://www.python.org/dev/peps/pep-0440/ # STOP AND READ! if you change: -__version__ = "3.1.17" +__version__ = "3.1.18" # also change: # - `docs/news.rst` to declare this as the current version or an unreleased one # - `psycopg_c/psycopg_c/version.py` to the same version. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psycopg-3.1.17/psycopg/setup.py new/psycopg-3.1.18/psycopg/setup.py --- old/psycopg-3.1.17/psycopg/setup.py 2024-01-07 02:41:20.000000000 +0100 +++ new/psycopg-3.1.18/psycopg/setup.py 2024-02-04 18:42:54.000000000 +0100 @@ -46,7 +46,7 @@ ], # Requirements needed for development "dev": [ - "black >= 23.1.0", + "black >= 24.1.0", "codespell >= 2.2", "dnspython >= 2.1", "flake8 >= 4.0", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psycopg-3.1.17/psycopg_c/.flake8 new/psycopg-3.1.18/psycopg_c/.flake8 --- old/psycopg-3.1.17/psycopg_c/.flake8 2024-01-07 02:41:20.000000000 +0100 +++ new/psycopg-3.1.18/psycopg_c/.flake8 2024-02-04 18:42:54.000000000 +0100 @@ -1,3 +1,3 @@ [flake8] max-line-length = 88 -ignore = W503, E203 +ignore = W503, E203, E704 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psycopg-3.1.17/psycopg_c/psycopg_c/_psycopg/generators.pyx new/psycopg-3.1.18/psycopg_c/psycopg_c/_psycopg/generators.pyx --- old/psycopg-3.1.17/psycopg_c/psycopg_c/_psycopg/generators.pyx 2024-01-07 02:41:20.000000000 +0100 +++ new/psycopg-3.1.18/psycopg_c/psycopg_c/_psycopg/generators.pyx 2024-02-04 18:42:54.000000000 +0100 @@ -240,7 +240,6 @@ r = pq.PGresult._from_ptr(pgres) if status == libpq.PGRES_PIPELINE_SYNC: results.append([r]) - break elif ( status == libpq.PGRES_COPY_IN or status == libpq.PGRES_COPY_OUT diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psycopg-3.1.17/psycopg_c/psycopg_c/types/datetime.pyx new/psycopg-3.1.18/psycopg_c/psycopg_c/types/datetime.pyx --- old/psycopg-3.1.17/psycopg_c/psycopg_c/types/datetime.pyx 2024-01-07 02:41:20.000000000 +0100 +++ new/psycopg-3.1.18/psycopg_c/psycopg_c/types/datetime.pyx 2024-02-04 18:42:54.000000000 +0100 @@ -4,6 +4,7 @@ # Copyright (C) 2021 The Psycopg Team +from libc.stdint cimport int64_t from libc.string cimport memset, strchr from cpython cimport datetime as cdt from cpython.dict cimport PyDict_GetItem @@ -391,7 +392,7 @@ if length != 10: self._error_date(data, "unexpected length") - cdef int vals[3] + cdef int64_t vals[3] memset(vals, 0, sizeof(vals)) cdef const char *ptr @@ -437,7 +438,7 @@ cdef object cload(self, const char *data, size_t length): - cdef int vals[3] + cdef int64_t vals[3] memset(vals, 0, sizeof(vals)) cdef const char *ptr cdef const char *end = data + length @@ -494,7 +495,7 @@ cdef object cload(self, const char *data, size_t length): - cdef int vals[3] + cdef int64_t vals[3] memset(vals, 0, sizeof(vals)) cdef const char *ptr cdef const char *end = data + length @@ -581,7 +582,7 @@ if self._order == ORDER_PGDM or self._order == ORDER_PGMD: return self._cload_pg(data, end) - cdef int vals[6] + cdef int64_t vals[6] memset(vals, 0, sizeof(vals)) cdef const char *ptr @@ -611,7 +612,7 @@ raise _get_timestamp_load_error(self._pgconn, data, ex) from None cdef object _cload_pg(self, const char *data, const char *end): - cdef int vals[4] + cdef int64_t vals[4] memset(vals, 0, sizeof(vals)) cdef const char *ptr @@ -721,7 +722,7 @@ if end[-1] == b'C': # ends with BC raise _get_timestamp_load_error(self._pgconn, data) from None - cdef int vals[6] + cdef int64_t vals[6] memset(vals, 0, sizeof(vals)) # Parse the first 6 groups of digits (date and time) @@ -862,9 +863,10 @@ if self._style == INTERVALSTYLE_OTHERS: return self._cload_notimpl(data, length) - cdef int days = 0, secs = 0, us = 0 + cdef int days = 0, us = 0 + cdef int64_t secs = 0 cdef char sign - cdef int val + cdef int64_t val cdef const char *ptr = data cdef const char *sep cdef const char *end = ptr + length @@ -908,7 +910,7 @@ break # Parse the time part. An eventual sign was already consumed in the loop - cdef int vals[3] + cdef int64_t vals[3] memset(vals, 0, sizeof(vals)) if ptr != NULL: ptr = _parse_date_values(ptr, end, vals, ARRAYSIZE(vals)) @@ -918,6 +920,10 @@ secs = vals[2] + 60 * (vals[1] + 60 * vals[0]) + if secs > 86_400: + days += secs // 86_400 + secs %= 86_400 + if ptr[0] == b'.': ptr = _parse_micros(ptr + 1, &us) @@ -966,11 +972,11 @@ # Work only with positive values as the cdivision behaves differently # with negative values, and cdivision=False adds overhead. cdef int64_t aval = val if val >= 0 else -val - cdef int us, ussecs, usdays + cdef int64_t us, ussecs, usdays - # Group the micros in biggers stuff or timedelta_new might overflow + # Group the micros in bigger stuff or timedelta_new might overflow with cython.cdivision(True): - ussecs = <int>(aval // 1_000_000) + ussecs = <int64_t>(aval // 1_000_000) us = aval % 1_000_000 usdays = ussecs // 86_400 @@ -988,7 +994,7 @@ cdef const char *_parse_date_values( - const char *ptr, const char *end, int *vals, int nvals + const char *ptr, const char *end, int64_t *vals, int nvals ): """ Parse *nvals* numeric values separated by non-numeric chars. @@ -1046,7 +1052,7 @@ cdef char sgn = ptr[0] # Parse at most three groups of digits - cdef int vals[3] + cdef int64_t vals[3] memset(vals, 0, sizeof(vals)) ptr = _parse_date_values(ptr + 1, end, vals, ARRAYSIZE(vals)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psycopg-3.1.17/psycopg_c/psycopg_c/version.py new/psycopg-3.1.18/psycopg_c/psycopg_c/version.py --- old/psycopg-3.1.17/psycopg_c/psycopg_c/version.py 2024-01-07 02:41:20.000000000 +0100 +++ new/psycopg-3.1.18/psycopg_c/psycopg_c/version.py 2024-02-04 18:42:54.000000000 +0100 @@ -6,6 +6,6 @@ # Use a versioning scheme as defined in # https://www.python.org/dev/peps/pep-0440/ -__version__ = "3.1.17" +__version__ = "3.1.18" # also change psycopg/psycopg/version.py accordingly. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psycopg-3.1.17/psycopg_pool/.flake8 new/psycopg-3.1.18/psycopg_pool/.flake8 --- old/psycopg-3.1.17/psycopg_pool/.flake8 2024-01-07 02:41:20.000000000 +0100 +++ new/psycopg-3.1.18/psycopg_pool/.flake8 2024-02-04 18:42:54.000000000 +0100 @@ -1,3 +1,3 @@ [flake8] max-line-length = 88 -ignore = W503, E203 +ignore = W503, E203, E704 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psycopg-3.1.17/psycopg_pool/psycopg_pool/pool.py new/psycopg-3.1.18/psycopg_pool/psycopg_pool/pool.py --- old/psycopg-3.1.17/psycopg_pool/psycopg_pool/pool.py 2024-01-07 02:41:20.000000000 +0100 +++ new/psycopg-3.1.18/psycopg_pool/psycopg_pool/pool.py 2024-02-04 18:42:54.000000000 +0100 @@ -826,8 +826,7 @@ pool.run_task(self) @abstractmethod - def _run(self, pool: "ConnectionPool") -> None: - ... + def _run(self, pool: "ConnectionPool") -> None: ... class StopWorker(MaintenanceTask): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psycopg-3.1.17/psycopg_pool/psycopg_pool/pool_async.py new/psycopg-3.1.18/psycopg_pool/psycopg_pool/pool_async.py --- old/psycopg-3.1.17/psycopg_pool/psycopg_pool/pool_async.py 2024-01-07 02:41:20.000000000 +0100 +++ new/psycopg-3.1.18/psycopg_pool/psycopg_pool/pool_async.py 2024-02-04 18:42:54.000000000 +0100 @@ -756,8 +756,7 @@ pool.run_task(self) @abstractmethod - async def _run(self, pool: "AsyncConnectionPool") -> None: - ... + async def _run(self, pool: "AsyncConnectionPool") -> None: ... class StopWorker(MaintenanceTask): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psycopg-3.1.17/tests/constraints.txt new/psycopg-3.1.18/tests/constraints.txt --- old/psycopg-3.1.17/tests/constraints.txt 2024-01-07 02:41:20.000000000 +0100 +++ new/psycopg-3.1.18/tests/constraints.txt 2024-02-04 18:42:54.000000000 +0100 @@ -17,7 +17,7 @@ pytest-randomly == 3.5.0 # From the 'dev' extra -black == 23.1.0 +black == 24.1.0 dnspython == 2.1.0 flake8 == 4.0.0 types-setuptools == 57.4.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psycopg-3.1.17/tests/fix_psycopg.py new/psycopg-3.1.18/tests/fix_psycopg.py --- old/psycopg-3.1.17/tests/fix_psycopg.py 2024-01-07 02:41:20.000000000 +0100 +++ new/psycopg-3.1.18/tests/fix_psycopg.py 2024-02-04 18:42:54.000000000 +0100 @@ -24,7 +24,6 @@ @pytest.fixture [email protected]_skip("2-phase commit") def tpc(svcconn): tpc = Tpc(svcconn) tpc.check_tpc() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psycopg-3.1.17/tests/scripts/dectest.py new/psycopg-3.1.18/tests/scripts/dectest.py --- old/psycopg-3.1.17/tests/scripts/dectest.py 2024-01-07 02:41:20.000000000 +0100 +++ new/psycopg-3.1.18/tests/scripts/dectest.py 2024-02-04 18:42:54.000000000 +0100 @@ -1,6 +1,7 @@ """ A quick and rough performance comparison of text vs. binary Decimal adaptation """ + from random import randrange from decimal import Decimal import psycopg diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psycopg-3.1.17/tests/scripts/pipeline-demo.py new/psycopg-3.1.18/tests/scripts/pipeline-demo.py --- old/psycopg-3.1.17/tests/scripts/pipeline-demo.py 2024-01-07 02:41:20.000000000 +0100 +++ new/psycopg-3.1.18/tests/scripts/pipeline-demo.py 2024-02-04 18:42:54.000000000 +0100 @@ -7,6 +7,7 @@ handled by execute() calls when pgconn socket is read-ready, which happens when the output buffer is full. """ + import argparse import asyncio import logging diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psycopg-3.1.17/tests/test_connection_async.py new/psycopg-3.1.18/tests/test_connection_async.py --- old/psycopg-3.1.17/tests/test_connection_async.py 2024-01-07 02:41:20.000000000 +0100 +++ new/psycopg-3.1.18/tests/test_connection_async.py 2024-02-04 18:42:54.000000000 +0100 @@ -606,7 +606,7 @@ async with aconn.cursor() as cur: assert isinstance(cur, MyCursor) - async with (await aconn.execute("select 1")) as cur: + async with await aconn.execute("select 1") as cur: assert isinstance(cur, MyCursor) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psycopg-3.1.17/tests/types/test_datetime.py new/psycopg-3.1.18/tests/types/test_datetime.py --- old/psycopg-3.1.17/tests/types/test_datetime.py 2024-01-07 02:41:20.000000000 +0100 +++ new/psycopg-3.1.18/tests/types/test_datetime.py 2024-02-04 18:42:54.000000000 +0100 @@ -713,6 +713,7 @@ ("-90d", "-3 month"), ("186d", "6 mons 6 days"), ("736d", "2 years 6 days"), + ("83063d,81640s,447000m", "1993534:40:40.447"), ], ) @pytest.mark.parametrize("fmt_out", pq.Format) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psycopg-3.1.17/tests/types/test_numeric.py new/psycopg-3.1.18/tests/types/test_numeric.py --- old/psycopg-3.1.17/tests/types/test_numeric.py 2024-01-07 02:41:20.000000000 +0100 +++ new/psycopg-3.1.18/tests/types/test_numeric.py 2024-02-04 18:42:54.000000000 +0100 @@ -402,9 +402,11 @@ @pytest.mark.parametrize( "fmt_in", [ - f - if f != PyFormat.BINARY - else pytest.param(f, marks=pytest.mark.crdb_skip("binary decimal")) + ( + f + if f != PyFormat.BINARY + else pytest.param(f, marks=pytest.mark.crdb_skip("binary decimal")) + ) for f in PyFormat ], )
