Skip to content

[Bug]: Server does not run on python < 3.13 #97

@njbrake

Description

@njbrake

What happened?

If you go to the helloworld example https://github.com/google/a2a-python/tree/main/examples/helloworld

And adjust it to run on python 3.12, it breaks.

Relevant log output

(.venv) *[main][~/scm/a2a-python/examples/helloworld]$ python test_client.py 
Traceback (most recent call last):
  File "/Users/nbrake/scm/a2a-python/examples/helloworld/.venv/lib/python3.12/site-packages/httpx/_transports/default.py", line 101, in map_httpcore_exceptions
    yield
  File "/Users/nbrake/scm/a2a-python/examples/helloworld/.venv/lib/python3.12/site-packages/httpx/_transports/default.py", line 394, in handle_async_request
    resp = await self._pool.handle_async_request(req)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/nbrake/scm/a2a-python/examples/helloworld/.venv/lib/python3.12/site-packages/httpcore/_async/connection_pool.py", line 256, in handle_async_request
    raise exc from None
  File "/Users/nbrake/scm/a2a-python/examples/helloworld/.venv/lib/python3.12/site-packages/httpcore/_async/connection_pool.py", line 236, in handle_async_request
    response = await connection.handle_async_request(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/nbrake/scm/a2a-python/examples/helloworld/.venv/lib/python3.12/site-packages/httpcore/_async/connection.py", line 103, in handle_async_request
    return await self._connection.handle_async_request(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/nbrake/scm/a2a-python/examples/helloworld/.venv/lib/python3.12/site-packages/httpcore/_async/http11.py", line 136, in handle_async_request
    raise exc
  File "/Users/nbrake/scm/a2a-python/examples/helloworld/.venv/lib/python3.12/site-packages/httpcore/_async/http11.py", line 106, in handle_async_request
    ) = await self._receive_response_headers(**kwargs)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/nbrake/scm/a2a-python/examples/helloworld/.venv/lib/python3.12/site-packages/httpcore/_async/http11.py", line 177, in _receive_response_headers
    event = await self._receive_event(timeout=timeout)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/nbrake/scm/a2a-python/examples/helloworld/.venv/lib/python3.12/site-packages/httpcore/_async/http11.py", line 217, in _receive_event
    data = await self._network_stream.read(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/nbrake/scm/a2a-python/examples/helloworld/.venv/lib/python3.12/site-packages/httpcore/_backends/anyio.py", line 32, in read
    with map_exceptions(exc_map):
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/nbrake/.local/share/uv/python/cpython-3.12.8-macos-aarch64-none/lib/python3.12/contextlib.py", line 158, in __exit__
    self.gen.throw(value)
  File "/Users/nbrake/scm/a2a-python/examples/helloworld/.venv/lib/python3.12/site-packages/httpcore/_exceptions.py", line 14, in map_exceptions
    raise to_exc(exc) from exc
httpcore.ReadTimeout

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/nbrake/scm/a2a-python/examples/helloworld/.venv/lib/python3.12/site-packages/a2a/client/client.py", line 247, in _send_request
    response = await self.httpx_client.post(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/nbrake/scm/a2a-python/examples/helloworld/.venv/lib/python3.12/site-packages/httpx/_client.py", line 1859, in post
    return await self.request(
           ^^^^^^^^^^^^^^^^^^^
  File "/Users/nbrake/scm/a2a-python/examples/helloworld/.venv/lib/python3.12/site-packages/httpx/_client.py", line 1540, in request
    return await self.send(request, auth=auth, follow_redirects=follow_redirects)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/nbrake/scm/a2a-python/examples/helloworld/.venv/lib/python3.12/site-packages/httpx/_client.py", line 1629, in send
    response = await self._send_handling_auth(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/nbrake/scm/a2a-python/examples/helloworld/.venv/lib/python3.12/site-packages/httpx/_client.py", line 1657, in _send_handling_auth
    response = await self._send_handling_redirects(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/nbrake/scm/a2a-python/examples/helloworld/.venv/lib/python3.12/site-packages/httpx/_client.py", line 1694, in _send_handling_redirects
    response = await self._send_single_request(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/nbrake/scm/a2a-python/examples/helloworld/.venv/lib/python3.12/site-packages/httpx/_client.py", line 1730, in _send_single_request
    response = await transport.handle_async_request(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/nbrake/scm/a2a-python/examples/helloworld/.venv/lib/python3.12/site-packages/httpx/_transports/default.py", line 393, in handle_async_request
    with map_httpcore_exceptions():
         ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/nbrake/.local/share/uv/python/cpython-3.12.8-macos-aarch64-none/lib/python3.12/contextlib.py", line 158, in __exit__
    self.gen.throw(value)
  File "/Users/nbrake/scm/a2a-python/examples/helloworld/.venv/lib/python3.12/site-packages/httpx/_transports/default.py", line 118, in map_httpcore_exceptions
    raise mapped_exc(message) from exc
httpx.ReadTimeout

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/nbrake/scm/a2a-python/examples/helloworld/test_client.py", line 45, in <module>
    asyncio.run(main())
  File "/Users/nbrake/.local/share/uv/python/cpython-3.12.8-macos-aarch64-none/lib/python3.12/asyncio/runners.py", line 194, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/Users/nbrake/.local/share/uv/python/cpython-3.12.8-macos-aarch64-none/lib/python3.12/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/nbrake/.local/share/uv/python/cpython-3.12.8-macos-aarch64-none/lib/python3.12/asyncio/base_events.py", line 686, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/Users/nbrake/scm/a2a-python/examples/helloworld/test_client.py", line 30, in main
    response = await client.send_message(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/nbrake/scm/a2a-python/examples/helloworld/.venv/lib/python3.12/site-packages/a2a/utils/telemetry.py", line 158, in async_wrapper
    result = await func(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/nbrake/scm/a2a-python/examples/helloworld/.venv/lib/python3.12/site-packages/a2a/client/client.py", line 167, in send_message
    **await self._send_request(
      ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/nbrake/scm/a2a-python/examples/helloworld/.venv/lib/python3.12/site-packages/a2a/utils/telemetry.py", line 158, in async_wrapper
    result = await func(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/nbrake/scm/a2a-python/examples/helloworld/.venv/lib/python3.12/site-packages/a2a/client/client.py", line 257, in _send_request
    raise A2AClientHTTPError(
a2a.client.errors.A2AClientHTTPError: HTTP Error 503: Network communication error: 
(.venv) *[main][~/scm/a2a-python/examples/helloworld]$

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions