Skip to content

Trio fails under gevent with NotImplementedError: unsupported platform #3013

Closed
@pg1671

Description

@pg1671

Trio is installed as a dependancy of httpx.

If I run the code:

from gevent.monkey import patch_all; patch_all()
import gevent
import httpx

def worker(n):
     print(n)

if __name__ == '__main__':
    jobs = [gevent.spawn(worker, job_no) for job_no in range(10)]
    gevent.joinall(jobs)

I get:

Traceback (most recent call last):
  File "/tests/gevent_test.py", line 3, in
    import httpx
  File "/work/env3.11/lib/python3.11/site-packages/httpx/init.py", line 2, in
    from ._api import delete, get, head, options, patch, post, put, request, stream
  File "/work/env3.11/lib/python3.11/site-packages/httpx/_api.py", line 6, in
    from ._client import Client
  File "/work/env3.11/lib/python3.11/site-packages/httpx/_client.py", line 32, in
    from ._transports.default import AsyncHTTPTransport, HTTPTransport
  File "/work/env3.11/lib/python3.11/site-packages/httpx/_transports/default.py", line 32, in
    import httpcore
  File "/work/env3.11/lib/python3.11/site-packages/httpcore/init.py", line 1, in
    from ._api import request, stream
  File "/work/env3.11/lib/python3.11/site-packages/httpcore/_api.py", line 5, in
    from ._sync.connection_pool import ConnectionPool
  File "/work/env3.11/lib/python3.11/site-packages/httpcore/_sync/init.py", line 1, in
    from .connection import HTTPConnection
  File "/work/env3.11/lib/python3.11/site-packages/httpcore/_sync/connection.py", line 12, in
    from .._synchronization import Lock
  File "/work/env3.11/lib/python3.11/site-packages/httpcore/_synchronization.py", line 11, in
    import trio
  File "/work/env3.11/lib/python3.11/site-packages/trio/init.py", line 23, in
    from ._core import TASK_STATUS_IGNORED as TASK_STATUS_IGNORED # isort: split
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/work/env3.11/lib/python3.11/site-packages/trio/_core/init.py", line 21, in
    from ._local import RunVar, RunVarToken
  File "/work/env3.11/lib/python3.11/site-packages/trio/_core/_local.py", line 9, in
    from . import _run
  File "/work/env3.11/lib/python3.11/site-packages/trio/_core/_run.py", line 2840, in
    raise NotImplementedError("unsupported platform")
NotImplementedError: unsupported platform

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions