Skip to content

Use importlib.resources to load typeshed resources #21861

Description

@Colecf

Feature

Use importlib.resources to load the typeshed resources, instead of finding them relative to __file__ in build.py.

Pitch

In android, we build all python binaries into self-contained zip files. So __file__ resolves to a path in a zip, and reading files relative to it fails. importlib.resources can handle both the zip case and the directory case transparently.

Currently we are using --custom-typeshed-dir as a workaround. (Code not public yet)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions