Skip to content

click.edit() Support Editor Paths Containing Spaces #1026

@heyglen

Description

@heyglen

Environment

  • Python 3.6.5
  • click 6.7
  • Windows 7

When using click.edit(), an editor with a space in the path throws an error. For example : "C:\Program Files\Sublime Text 3\sublime_text.exe"

If I put quotes around the path name in the subprocess.Popen call here the problem is fixed.

Before

            c = subprocess.Popen('%s "%s"' % (editor, filename),
                                 env=environ, shell=True)

After

            c = subprocess.Popen('"%s" "%s"' % (editor, filename),
                                 env=environ, shell=True)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugwindowsIssues pertaining to the Windows environment

    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