From 772961db06dcbe189f1001cf1a4feaea9485e33c Mon Sep 17 00:00:00 2001 From: igo95862 Date: Sun, 21 Dec 2025 20:08:43 +0000 Subject: [PATCH 1/7] Version 0.14.2 --- CHANGELOG.md | 7 +++++++ setup.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e66c69..5c9a348 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## 0.14.2 + +### Fixes + +* Fix segmentation fault if export handle outlives the exported object. (reported by @arkq) +* Fix some tests failing on slow systems. + ## 0.14.1 ### Features diff --git a/setup.py b/setup.py index 5b32c5b..199b300 100644 --- a/setup.py +++ b/setup.py @@ -96,7 +96,7 @@ def get_link_arguments() -> list[str]: 'Based on sd-bus from libsystemd.'), long_description=long_description, long_description_content_type='text/markdown', - version='0.14.1.post0', + version='0.14.2', url='https://github.com/python-sdbus/python-sdbus', author='igo95862', author_email='igo95862@yandex.ru', From 8b03330e6648dc43fceaf2a4fb6c5a4409395b6d Mon Sep 17 00:00:00 2001 From: Beaverr Date: Sat, 11 Apr 2026 13:51:57 -0500 Subject: [PATCH 2/7] Fix generated code for signals --- src/sdbus/interface_generator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sdbus/interface_generator.py b/src/sdbus/interface_generator.py index 27aca92..12bb577 100644 --- a/src/sdbus/interface_generator.py +++ b/src/sdbus/interface_generator.py @@ -722,7 +722,7 @@ def {{ a_property.python_name }}(self) -> {{ a_property.typing }}: flags={{ signal.flags_str }}, {% endif %} {% if signal.wants_rename %} - signal_name=signal.method_name, + signal_name="{{signal.method_name}}", {% endif %} ) def {{ signal.python_name }}(self) -> {{ signal.typing }}: From 90432a805e6cc6f4135f26c9efa755191e3fc33a Mon Sep 17 00:00:00 2001 From: Leopold Luley Date: Sat, 8 Aug 2026 23:24:14 +0200 Subject: [PATCH 3/7] Fix returned file descriptors data type being closed immediatly According to libsystemd man page the returned file descriptor is owned by the message and must be duplicated before being used elsewhere. https://man.archlinux.org/man/core/systemd-libs/sd_bus_message_read_basic.3.en --------- Co-authored-by: Leopold Luley --- src/sdbus/sd_bus_internals_message.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/sdbus/sd_bus_internals_message.c b/src/sdbus/sd_bus_internals_message.c index f5631b3..71d9b0e 100644 --- a/src/sdbus/sd_bus_internals_message.c +++ b/src/sdbus/sd_bus_internals_message.c @@ -18,6 +18,7 @@ License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include #include "sd_bus_internals.h" void _SdBusMessage_set_messsage(SdBusMessageObject* self, sd_bus_message* new_message) { @@ -800,6 +801,10 @@ static PyObject* _iter_basic(sd_bus_message* message, char basic_type) { case 'h': { int new_fd = 0; CALL_SD_BUS_AND_CHECK(sd_bus_message_read_basic(message, basic_type, &new_fd)); + + // The fd is owned by the message and would be closed after the end of the message's lifetime + new_fd = CALL_SD_BUS_AND_CHECK(fcntl(new_fd, F_DUPFD_CLOEXEC, 3)); + return PyLong_FromLong((long)new_fd); break; } From 1f81cd72a3a7979b7495eb31b40e7e0a8542f723 Mon Sep 17 00:00:00 2001 From: igo95862 Date: Thu, 20 Aug 2026 17:14:15 +0100 Subject: [PATCH 4/7] ci: Rename CI file name --- .github/workflows/{ubuntu_test.yml => ci.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{ubuntu_test.yml => ci.yml} (100%) diff --git a/.github/workflows/ubuntu_test.yml b/.github/workflows/ci.yml similarity index 100% rename from .github/workflows/ubuntu_test.yml rename to .github/workflows/ci.yml From 0280fe747ec04f5ab74d557d16cbb91903c476b2 Mon Sep 17 00:00:00 2001 From: igo95862 Date: Thu, 20 Aug 2026 17:19:54 +0100 Subject: [PATCH 5/7] ci: Update checkout version --- .github/workflows/ci.yml | 8 ++++---- .github/workflows/ubuntu_pypi_test.yml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6a028ea..dd54930 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Checkout - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Install dependencies run: | sudo apt update @@ -30,7 +30,7 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Checkout - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Install dependencies run: | sudo apt update @@ -49,7 +49,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Install dependencies run: | sudo apt update @@ -68,7 +68,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Build Alpine container run: | podman build --tag alpine-ci -f ./test/containers/Containerfile-alpine . diff --git a/.github/workflows/ubuntu_pypi_test.yml b/.github/workflows/ubuntu_pypi_test.yml index 495bc7f..cb845d6 100644 --- a/.github/workflows/ubuntu_pypi_test.yml +++ b/.github/workflows/ubuntu_pypi_test.yml @@ -23,7 +23,7 @@ jobs: runs-on: ${{ matrix.ubuntu_version }} steps: - name: Checkout - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Install dependencies run: | sudo apt-get update From 5a58c17ed13e975cb0f82340004d5a5ff32e9a91 Mon Sep 17 00:00:00 2001 From: igo95862 Date: Thu, 20 Aug 2026 17:26:05 +0100 Subject: [PATCH 6/7] ci: Use Ubuntu 24.04 for linters CI Stabilizes the linters versions. --- .github/workflows/ci.yml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dd54930..6a41a9d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -46,21 +46,18 @@ jobs: PYTHONPATH=./build-lib python3 -m unittest --verbose lint: name: Run linters on the code - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - name: Checkout uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Install dependencies run: | sudo apt update - sudo apt install python3 python3-pip ninja-build - python -m venv --system-site-packages venv - ./venv/bin/pip install --upgrade \ - mypy isort flake8 pyflakes pycodestyle \ - jinja2 'Sphinx<8.0' types-setuptools meson + sudo apt install python3 meson ninja-build \ + mypy isort flake8 pycodestyle \ + python3-jinja2 python3-sphinx python3-typeshed - name: Run linters run: | - export PATH="$(readlink -f ./venv/bin):${PATH}" meson setup build meson compile -C build lint-python alpine: From cf211a7a86e2f0cff92ad93d11bea1e1decfb4c2 Mon Sep 17 00:00:00 2001 From: igo95862 Date: Thu, 20 Aug 2026 17:45:36 +0100 Subject: [PATCH 7/7] Version 0.14.3 --- CHANGELOG.md | 8 ++++++++ setup.py | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c9a348..b9e88db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +## 0.14.3 + +### Fixes + +* Fix code generated signals not using proper member name. (reported and fixed by @SqueakyBeaver) +* Fix file descriptors from D-Bus messages (type `h`) instantly being closed after message + was parsed. (reported and fixed by @luleyleo) + ## 0.14.2 ### Fixes diff --git a/setup.py b/setup.py index 199b300..80410bd 100644 --- a/setup.py +++ b/setup.py @@ -96,7 +96,7 @@ def get_link_arguments() -> list[str]: 'Based on sd-bus from libsystemd.'), long_description=long_description, long_description_content_type='text/markdown', - version='0.14.2', + version='0.14.3', url='https://github.com/python-sdbus/python-sdbus', author='igo95862', author_email='igo95862@yandex.ru',