Tried a bunch of things to make webbrowser.open work with no luck, so used this alternative
import os
os.system('vivaldi myfile.html')
Obviously it requires you to have the Vivaldi browser installed. Maybe it would work with other browsers, but I didn't test it