Skip to content

AttributeError: 'WindowsPath' object has no attribute 'lower'. #2455

Closed
@wkitlasten

Description

@wkitlasten

Describe the bug
AttributeError: 'WindowsPath' object has no attribute 'lower'.

To Reproduce
sim.run_simulation()

Expected behavior
Run the simulation

Desktop (please complete the following information):
Edition Windows 10 Enterprise
Version 22H2
OS build 19045.5371

Additional context
From flopy/mbase.py, line 86 (last line below):

def _resolve(exe_name, checked=set()):
        # Prevent infinite recursion by checking if exe_name has been checked
        if exe_name in checked:
            return None
        checked.add(exe_name)

        # exe_name is found (not None), ensure absolute path is returned
        if exe := which(str(exe_name)):
            return which(str(Path(exe).resolve()))

        # exe_name is relative path
        if not Path(exe_name).is_absolute() and (
            exe := which(str(Path(exe_name).expanduser().resolve()), mode=0)
        ):
            # expanduser() in case of ~ in path
            # mode=0 effectively allows which() to find exe without suffix in windows
            return exe

        # try adding/removing .exe suffix
        if exe_name.lower().endswith(".exe"):

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions