Skip to content

[Feature] Support Android as a posix platform #131

Closed

Description

@NTFSvolume

On Python 3.13+, sys.platform reports android as a valid platform instead of just linux

Installing a package on Termux that uses readchar throws the following exception on startup:

File "/data/data/com.termux/files/home/.local/share/uv/tools/cyberdrop-dl-patched/lib/python3.13/site-packages/inquirer/events.py", line 1, in <module>
    import readchar
  File "/data/data/com.termux/files/home/.local/share/uv/tools/cyberdrop-dl-patched/lib/python3.13/site-packages/readchar/__init__.py", line 21, in <module>
    raise NotImplementedError(f"The platform {platform} is not supported yet")
NotImplementedError: The platform android is not supported yet

Adding android to the check here was enough to fix it for me:

if platform.startswith(("linux", "darwin", "freebsd", "openbsd")):

Everything is working as expected AFAIK. I will try to run the test suite and report back

Activity

  1. NTFSvolume commented on Apr 5, 2026

    @NTFSvolume
    Author

    After some similar modifications to conftest.py, everything passes:

    ======================================= warnings summary =======================================
    ../../../../data/data/com.termux/files/usr/lib/python3.13/site-packages/coverage/core.py:108
      /data/data/com.termux/files/usr/lib/python3.13/site-packages/coverage/core.py:108: CoverageWarning: Couldn't import C tracer: No module named 'coverage.tracer' (no-ctracer); see https://coverage.readthedocs.io/en/7.13.5/messages.html#warning-no-ctracer
        warn(f"Couldn't import C tracer: {IMPORT_ERROR}", slug="no-ctracer", once=True)
    
    -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
    ======================================== tests coverage ========================================
    ______________________ coverage: platform android, python 3.13.12-final-0 ______________________
    
    Name                      Stmts   Miss  Cover
    ---------------------------------------------
    readchar/__init__.py         13      4    69%
    readchar/_base_key.py        31      0   100%
    readchar/_config.py           6      1    83%
    readchar/_posix_key.py       30      0   100%
    readchar/_posix_read.py      30      1    97%
    readchar/_win_key.py         28     28     0%
    readchar/_win_read.py        14     14     0%
    readchar/key.py               5      5     0%
    ---------------------------------------------
    TOTAL                       157     53    66%
    ================================ 273 passed, 1 warning in 8.74s ================================
    /sdcard/python-readchar $
  2. NTFSvolume commented on Apr 5, 2026

    @NTFSvolume
    Author
  3. Cube707 commented on Apr 6, 2026

    @Cube707
    Collaborator

    "Doppelt hält besser" 😄 (double is better than never at all)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions