Skip to content

Android API levels are allowed to be non-integers #162196

Open

Description

@freakboy3742

Bug report

sys.getandroidapilevel(), and the api_level attribute of platform.android_ver() both expect the Android API level to be expressed as an integer.

Prior to Android 16, this was a reasonable assumption; Google used integer versions for API levels, and when they released a point/variant version of Android (e.g., 12L or 8.1), they would increment the API level.

However, since then:

  • Android 16 QPR2 uses an Android API level of 36.1
  • Android 17 QPR1 uses an Android API level of 37.1
  • Android 17 QPR2 uses an Android API level of 37.2

So - the documented return type of these two methods can no longer reflect the full Android API level.

CPython versions tested on:

CPython main branch

Operating systems tested on:

Other

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

Metadata

Metadata

Assignees

Labels

OS-androidtype-bugAn unexpected behavior, bug, or error

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions