Skip to content

Use get_ext_fullpath in ffiplatform._build - #283

Merged
mattip merged 3 commits into
python-cffi:mainfrom
mattip:get_ext_fullpath
Oct 6, 2026
Merged

mattip merged 3 commits into
python-cffi:mainfrom
mattip:get_ext_fullpath

Conversation

@mattip

@mattip mattip commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Continuation of #273 which was closed before merging

afonsojanu and others added 3 commits August 30, 2026 01:08
get_outputs() returns every output the build_ext command produced, not
just the one we asked it to build. When the Distribution/build_ext
state ends up carrying more than one extension (as reported in python-cffi#246,
where the caller's own project already has other native extensions
registered), the unconditional [soname] = cmd_obj.get_outputs()
unpacking crashes with a bare ValueError instead of naming the
extension we actually wanted.

get_ext_fullpath(ext.name) asks build_ext directly for the path of the
specific extension we passed in, so it no longer depends on exactly
one output existing. This also gives a clearer failure mode for python-cffi#229,
where a beginner hit the same unpacking crash with no way to tell what
went wrong.
Simpler, and drops the now-unneeded binascii import.
@mattip

mattip commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @afonsojanu sorry it took so long

@mattip
mattip merged commit ed994e0 into python-cffi:main Oct 6, 2026
38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants