Skip to content

click.launch() does not work for (non local) urls on Windows #3164

@karpierz

Description

@karpierz

Environment:

  • Python version: 3,13
  • Click version: 8.3.1
  • OS: Windows (11)

click.launch() (precisely: click._termui_impl.open_url()) does not work for (non local) urls on Windows.
e.g. click.launch("http://www.python.org") does not work.

The patch:

--- click/_termui_impl.py.org	2025-12-03 16:55:34.202910500 +0100
+++ click/_termui_impl.py	2025-12-03 21:44:31.351834200 +0100
@@ -707,7 +707,7 @@
             args.append("")
             args.append(url)
         try:
-            return subprocess.call(args)
+            return subprocess.call(args, shell=True)
         except OSError:
             # Command not found
             return 127

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