From 772961db06dcbe189f1001cf1a4feaea9485e33c Mon Sep 17 00:00:00 2001 From: igo95862 Date: Sun, 21 Dec 2025 20:08:43 +0000 Subject: [PATCH 1/3] 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/3] 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/3] 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; }