Skip to content

Error in setup.ps1 when spaces in hosted tools path on Windows (actions/python-versions repository) #1290

@franciscogarcia-payroc

Description

@franciscogarcia-payroc

Description:
We stumbled on to an error with the setup.ps1 file packaged in with the versions. We are leveraging the Azure DevOps task which seems to get it's setup file and versions from the python-versions repository. The setup script doesn't handle paths with spaces in it as expected, and instead of installing normally we get an error 'C:\Program' is not recognized as an internal or external command, operable program or batch file. There is a pull request in the python-versions repository that quotes several instances where spaces in path could cause problems linked here:

actions/python-versions#378

But it's awaiting review from a maintainer. I'm posting here for more visibility and to open any discussion around the proposed fix.

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Tools version:
All

Repro steps:
Try to install via setup.ps1 where the hosted tools cache directory has a space in the name.

Expected behavior:
Installation and configuration should happen normally

Actual behavior:
An error outputs upon installation:
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
'C:\Program' being an example but any path with a space should result in the same partial path error

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions