File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,6 +5,9 @@ Version 8.3.3
55
66Unreleased
77
8+ - Use :func: `os.startfile ` on Windows to open URLs in :func: `open_url `,
9+ replacing the ``start `` built-in which cannot be invoked without
10+ ``shell=True ``. :issue: `3164 ` :pr: `3186 `
811- Use :func: `shlex.split ` to split pager and editor commands into ``argv ``
912 lists for :class: `subprocess.Popen `, removing ``shell=True ``.
1013 :issue: `1026 ` :pr: `1477 ` :pr: `2775 `
Original file line number Diff line number Diff line change @@ -720,17 +720,16 @@ def _unquote_file(url: str) -> str:
720720 if locate :
721721 url = _unquote_file (url )
722722 args = ["explorer" , f"/select,{ url } " ]
723+ try :
724+ return subprocess .call (args )
725+ except OSError :
726+ return 127
723727 else :
724- args = ["start" ]
725- if wait :
726- args .append ("/WAIT" )
727- args .append ("" )
728- args .append (url )
729- try :
730- return subprocess .call (args )
731- except OSError :
732- # Command not found
733- return 127
728+ try :
729+ os .startfile (url ) # type: ignore[attr-defined]
730+ except OSError :
731+ return 127
732+ return 0
734733 elif CYGWIN :
735734 if locate :
736735 url = _unquote_file (url )
You can’t perform that action at this time.
0 commit comments