Skip to content

Error when using interactive mode in windows: '...\Programs\Microsoft' is not recognized as an internal or external command, ... #430

@saltball

Description

@saltball

Description of your problem

It happens when i use the interactive mode. I got error message as below:

'C:\Users\***\AppData\Local\Programs\Microsoft' is not recognized as an internal or external command,
operable program or batch file.
ERROR:

(I omit my account info using ***.)
Same error happens on both powershell and cmd.
Please provide a minimal, self-contained, and reproducible example.
I try to locate the error, so i make a py script. It's part of the open file with editor. I got a familiar error.

from pyscaffold.shell import *
from pyscaffold import file_system

with file_system.tmpfile(prefix="pyscaffold-", suffix=".args.sh") as file:
    content = edit(file).read_text("utf-8")

It seems the space in vscode path ruin the function get_executable() in shell.py.

Please provide any additional information below.
I'm not sure whether it's my computer's problem. But when i change line 157 in shell.py from

        return executable

to

        return name

There is no error.

And I wonder if the function get_excutable() could deal with any space in path of env, editor or any other commands.

Versions and main components

  • PyScaffold Version: 4.0.1
  • Python Version: not specified
  • Operating system: Win10
  • How did you install PyScaffold: conda

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions