diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2b44c5e..eddfdbe 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,12 +11,12 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.7", "3.10"] + python-version: ["3.7", "3.10", "3.12"] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - name: Install APT depenencies @@ -35,7 +35,7 @@ jobs: run: | coverage xml coverage report -m - - uses: codecov/codecov-action@v2 + - uses: codecov/codecov-action@v3 if: ${{ always() }} with: token: ${{ secrets.CODECOV_TOKEN }} @@ -44,11 +44,11 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Set up Python 3.10 - uses: actions/setup-python@v2 + - uses: actions/checkout@v4 + - name: Set up Python 3.12 + uses: actions/setup-python@v4 with: - python-version: "3.10" + python-version: "3.12" - name: Install Python dependencies run: | python -m pip install --upgrade pip @@ -64,11 +64,11 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Set up Python 3.10 - uses: actions/setup-python@v2 + - uses: actions/checkout@v4 + - name: Set up Python 3.12 + uses: actions/setup-python@v4 with: - python-version: "3.10" + python-version: "3.12" - name: Install dependencies run: | python -m pip install --upgrade pip diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index de1b2b5..b2ca3ea 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,11 +9,11 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Set up Python 3.10 - uses: actions/setup-python@v2 + - uses: actions/checkout@v4 + - name: Set up Python 3.12 + uses: actions/setup-python@v4 with: - python-version: "3.10" + python-version: "3.12" - name: Install dependencies run: | python -m pip install --upgrade pip @@ -22,6 +22,6 @@ jobs: run: | python -m build - name: Publish distribution 📦 to PyPI - uses: pypa/gh-action-pypi-publish@master + uses: pypa/gh-action-pypi-publish@release/v1 with: password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/knxdclient/client.py b/knxdclient/client.py index 5c8144b..80f1cad 100644 --- a/knxdclient/client.py +++ b/knxdclient/client.py @@ -182,8 +182,8 @@ async def run(self): # A connection, timeout or cancellation errors # typically mean we cannot proceed further with this connection. # Thus we abort the receive loop execution with the exception. - logger.error("A connection, timeout or cancellation error has occurred. " - "Aborting current connection: %s", error) + logger.error("Error while waiting for next packet from KNXd: %s. " + "Exiting from receive loop.", repr(error)) self._run_exited.set() raise except Exception as e: diff --git a/test/test_client.py b/test/test_client.py index 64720d1..ad121de 100644 --- a/test/test_client.py +++ b/test/test_client.py @@ -265,6 +265,7 @@ async def test_timeout(self) -> None: async def client_handler(reader, writer): # We never respond anything, so the client should run into timeout await reader.read(-1) + writer.close() server = await asyncio.start_server(client_handler, host="127.0.0.1", port=16720) try: @@ -278,6 +279,7 @@ async def client_handler(reader, writer): with self.assertRaises(TimeoutError if sys.version_info >= (3, 11) else asyncio.TimeoutError): await run_task + await connection.stop() finally: server.close() await server.wait_closed()