Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fallback to system default browser #92

Closed
daurnimator opened this Issue · 6 comments

3 participants

@daurnimator

If a browser is not specified in config or cannot be found, the system default should be used.

On linux this just involved running xdg-open http://myurl.com
On windows just run start http://myurl.com

@titoBouzout
Owner

good idea

@titoBouzout titoBouzout referenced this issue from a commit
@titoBouzout Semi fixes #92 ad48ceb
@titoBouzout
Owner

kinda added the required stuff, but it does not work in my windows machine.

@daurnimator

What happens? I don't have windows easily available to test.

@mklement0

There are 2 caveats with start:

It's not a separate executable, so you need cmd /c to invoke it
If you need to double-quote the URL (some URLs, such as those containing & would otherwise break the command), you need an extra parameter before the URL - "".

In short, you'll need to launch the equivalent of something like:

cmd /c start "" "http://boston.com"

@mklement0

Couldn't translate the above into the array-based method of invoking subprocess.Popen().
The string-scalar approach works, however, on both Python 2.7.4 and 3.3.1:

subprocess.Popen('cmd /c start "" "' + url + '"')

@titoBouzout
Owner

It works, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.