aparrish / pronouncingpy

A simple interface for the CMU pronouncing dictionary
BSD 3-Clause "New" or "Revised" License
301 stars 42 forks source link

Replace 'open' with a portable command #16

Closed salty-horse closed 7 years ago

salty-horse commented 7 years ago

'open' is only available on Mac, which made 'coverage' and 'docs' fail on Linux. Since we already depend on Python, we can use the webbrowser module.

hugovk commented 7 years ago

I'm not too bothered about it, but this doesn't quite work with Windows. In cmd.exe:

python -m webbrowser htmlcov/index.html opens http://htmlcov/index.html in IE with a 404 (instead of the default Chrome).

python -m webbrowser htmlcov\index.html open in Chrome correctly.

python -m webbrowser file:///C:/Users/hugovk/github/pronouncingpy/htmlcov/index.html works

In Git Bash (MINGW64) only the last one works.

salty-horse commented 7 years ago

Did it work with open on Windows, or was this broken before? I thought MINGW takes care of pathnames.

hugovk commented 7 years ago

It was broken before with open. So this PR is at least a positive step in fixing for Linux.