[Python-Dev] New winreg module really an improvement?

Neil Hodgson nhodgson@bigpond.net.au
Tue, 1 Aug 2000 20:47:12 +1000


> So what to do?  Anyone?  If even _one_ experienced Windows developer on
> this list can say they believe "winreg" is appropriate and intuitive, I am
> happy to shut up (and then simply push for better winreg documentation ;-)

   Sorry but my contribution isn't going to help much with breaking the
impasse.

   Registry code tends to be little lumps of complexity you don't touch once
it is working. The Win32 Reg* API is quite ugly - RegCreateKeyEx
takes/returns 10 parameters but you only normally want 3 and the return
status and everyone asks for KEY_ALL_ACCESS until the installation testers
tell you it fails for non-Administrators. So it would be good if the API was
simpler and defaulted everything you don't need to set.

   But I only hack the registry about once a year with Python. So if its
closer to the Win32 API then that helps me to use existing knowledge and
documentation.

   When writing an urllib patch recently, winreg seemed OK. Is it complete
enough? Are the things you can't do with it important for its role? IMO, if
winreg can handle the vast majority of cases (say, 98%) then its a useful
tool and people who need RegSetKeySecurity and similar can go to win32api.
Do the distutils developers know how much registry access they need?

   Enough fence sitting for now,

   Neil