Skip to content

Simulator classes cannot be instantiated with WSL + linux LS-DYNA executable using python >=3.12.8 #975

@ocrabb

Description

@ocrabb

BaseSimulator.dyna_settings.lsdyna_path is checked using shutil.which(). It seems as of python 3.12.8 for windows shutil.which() no longer recognises executables without an extension, which is the case for linux executables that would be run in WSL. This causes the BaseSimulator.dyna_settings.lsdyna_path check to fail and the python execution to stop.

I found this PR in the python repo that might be the origin of the problem: python/cpython#127035. The changes cause shutil.which() to recognize executables without extensions only if the windows PATHEXT environment value contains dot-only entries (e.g. '.' or '..' ), which is not the default on windows.

Adding '.' to the PATHEXT environment variable fixes the problem.
Adding an extension contained in PATHEXT to the linux executable also fixes the problem (e.g. rename 'dyna' into 'dyna.exe').

A warning to users might be useful as python 3.12 is listed as being supported by the package.

Metadata

Metadata

Assignees

No one assigned

    Labels

    dependenciesRelated with project dependenciesmaintenanceGeneric maintenance related

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions