[issue8232] webbrowser.open incomplete on Windows
eryksun
report at bugs.python.org
Wed Apr 15 01:28:28 CEST 2015
eryksun added the comment:
> register themselves in HKEY_LOCAL_MACHINE\SOFTWARE\
> Clients\StartMenuInternet so that users can change their
> default browser through the OS. On 64-bit systems, this
> is always in the 64-bit registry
According to "Registry Keys Affected by WOW64", the "Clients" key is redirected in Vista and shared in Windows 7.
https://msdn.microsoft.com/en-us/library/aa384253
import winreg
HKLM = winreg.HKEY_LOCAL_MACHINE
subkey = r'Software\Clients\StartMenuInternet'
read32 = winreg.KEY_READ | winreg.KEY_WOW64_32KEY
read64 = winreg.KEY_READ | winreg.KEY_WOW64_64KEY
key32 = winreg.OpenKey(HKLM, subkey, access=read32)
key64 = winreg.OpenKey(HKLM, subkey, access=read64)
# This should be true in Windows 7.
assert winreg.QueryInfoKey(key32) == winreg.QueryInfoKey(key64)
I don't have a Vista installation to confirm that it's really redirected. If so, it's important to enumerate the WOW64 redirected key as well, since 32-bit browsers are still common on Windows.
----------
nosy: +eryksun
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue8232>
_______________________________________
More information about the Python-bugs-list
mailing list