[python-win32] _winreg.LoadKey

Tim Roberts timr at probo.com
Thu Nov 30 19:13:33 CET 2006


Avery.Andrews at anu.edu.au wrote:
> Does anyone know how to use _winreg.Loadkey, or whether it is even
> implemented properly, in 2.4.2 and 2.5 (the fact that it is named
> wrong in the Docs and not covered in the test suites doesn't inspire
> confidence).
>
> I find that I can use it to load a key into the top level
> (HKEY_LOCAL_MACHINE), but that various things don't appear
> to be released properly when Python exits, in that neither the
> key itself can be changed with regedt32, nor the file it
> was read in from deleted (due to being in use by another process),
> until the system is rebooted.
>   

That last item is to be expected.  When you load a key like this, your
file becomes part of the live registry.  The registry service will map
the file into memory and keep it open until the key is unloaded.

-- 
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.



More information about the Python-win32 mailing list