A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2018-January/151666.html below:

[Python-Dev] subprocess not escaping "^" on Windows

[Python-Dev] subprocess not escaping "^" on WindowsSteve Dower steve.dower at python.org
Mon Jan 8 16:26:26 EST 2018
On 09Jan2018 0744, eryk sun wrote:
> It's common to discourage using `shell=True` because it's considered
> insecure. One of the reasons to use CMD in Windows is that it tries
> ShellExecuteEx if CreateProcess fails. ShellExecuteEx supports "App
> Paths" commands, file actions (open, edit, print), UAC elevation (via
> "runas" or if requested by the manifest), protocols (including
> "shell:"), and opening folders in Explorer. It isn't a scripting
> language, however, so it doesn't pose the same risk as using CMD.
> Calling ShellExecuteEx could be integrated in subprocess as a new
> Popen parameter, such as `winshell` or `shellex`.

This can also be used directly as os.startfile, the only downside being 
that you can't wait for the process to complete (but that's due to the 
underlying API, which may not end up starting a process but rather 
sending a message to an existing long-running one such as explorer.exe). 
I'd certainly recommend it for actions like "open this file with its 
default editor" or "browse to this web page with the default browser".

Cheers,
Steve

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4