diff --git a/.github/workflows/ubuntu_test.yml b/.github/workflows/ci.yml similarity index 74% rename from .github/workflows/ubuntu_test.yml rename to .github/workflows/ci.yml index 6a028ea..6a41a9d 100644 --- a/.github/workflows/ubuntu_test.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 @@ -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@b4ffde65f46336ab88eb53be808477a3936bae11 + 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: @@ -68,7 +65,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 diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e66c69..b9e88db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,18 @@ +## 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 + +* 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..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.1.post0', + version='0.14.3', url='https://github.com/python-sdbus/python-sdbus', author='igo95862', author_email='igo95862@yandex.ru', 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 }}: 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; }