Skip to content

Installer script path with spaces causes PowerShell CommandNotFoundException on Windows #2337

@sha-ahammed

Description

@sha-ahammed

When the Windows username contains a space (e.g. Sha Roze), the temp path used to invoke the downloaded .ps1 installer script is not quoted. PowerShell tokenizes the path on the space, treating the first segment as a command name, causing the update to fail entirely.

I encountered this bug when trying to update uv using its self update command.

Steps to Reproduce

  1. Have a Windows user account whose name contains a space (e.g. C:\Users\Sha Roze)
  2. Install uv via the standalone installer
  3. Run uv self update

Error Output

C:\Users\Sha : The term 'C:\Users\Sha' is not recognized as the name of a cmdlet,
function, script file, or operable program. Check the spelling of the name, or if
a path was included, verify that the path is correct and try again.
At line:1 char:1
+ C:\Users\Sha Roze\AppData\Local\Temp\.tmpGjtrqF\installer.ps1
+ ~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (C:\Users\Sha:String) [],
      CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

Environment

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