Skip to content

Incorrect pymalloc ABI for CPython 3.7 on Windows #172

@tttapa

Description

@tttapa

Describe the bug

The m ABI flag is missing on some systems. E.g. for CPython 3.7 on Windows, distlib.wheel.ABI is cp37 when it should be cp37m.
As a result, the wheel file produced by distlib.wheel.Wheel cannot be installed on the system that produced it.

To Reproduce

import distlib.wheel
print(distlib.wheel.ABI)
import packaging.tags
print(next(packaging.tags.sys_tags()).abi)
distlib:   cp37
packaging: cp37m

See: https://github.com/tttapa/test-distlib-abi/runs/6639692380?check_suite_focus=true#check-step-5

Expected behavior

On Python 3.7 and earlier, m should be appended to the ABI string when the WITH_PYMALLOC config variable is None.
See the packaging implementation here: https://github.com/pypa/packaging/blob/69f21513cac4e742863e286f37b46022bf938da8/packaging/tags.py#L147-L150
And compare it to what distlib does now:

distlib/distlib/wheel.py

Lines 63 to 64 in 052787b

if sysconfig.get_config_var('WITH_PYMALLOC'):
parts.append('m')

Environment

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