Skip to content

_is_dynamic fails on submodule in .so file #354

Description

@henryiii

When _is_dynamic checks a module, it only looks for the __spec__ and __file__ of the module being checked, and if that is not defined, it looks for the __path__ on the module above. For a PyBind11 module with a submodule, the __file__ is defined on the main module, but not submodules, and there is no __path__. So things in submodules cannot be cloudpickled.

I think the function should be recursively checking up the the module path, and shouldn't try to access parent.__path__ without a check or try.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions