Am 12.01.16 um 18:52 schrieb Chris Angelico:
On Wed, Jan 13, 2016 at 4:37 AM, eryk sun <eryk...@gmail.com> wrote:

start is a shell command. It also has a quirk that the first quoted
argument is the window title. Here's the correct call:

     subprocess.check_call('start "title" "%s"' % url, shell=True)

Is that properly escaped to handle any arbitrary URL? I doubt it.

Do you actually need shell=True? I would strongly recommend using the
form that I used, unless it can be proven that that doesn't work.

As stated, start is not an executable on Windows, but it is a built-in command of cmd.exe. And thus it has very quirky quotation rules. This is unlike Linux, where "xdg-open" is a shell script, and OSX, where "open" is a binary executable.
        
        Christian

--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to