Move webbrowser.open outside of the with block to avoid lazy file write attempt.