Skip to content

Regression in 3.13.1 for imports of nonexistant names from CFFI modules #128030

Closed
@stefanor

Description

@stefanor

Bug report

Bug description:

cffi's TestNewFFI1.test_import_from_lib started failing with:

>           from _test_import_from_lib.lib import bar
E           TypeError: bad argument type for built-in operation

This is where _test_import_from_lib is a CFFI C extension, which does not contain a member lib.bar. So in this case _test_import_from_lib.lib probably doesn't have an origin.

More details here: python-cffi/cffi#150

The offending change seems to be the introduction of PyModule_GetFilenameObject in #127775. (@hauntsaninja, @serhiy-storchaka)

CPython versions tested on:

3.13

Operating systems tested on:

Linux

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.13bugs and security fixes3.14bugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions