[Python-Dev] winreg

Thomas Heller thomas.heller@ion-tof.com
Tue, 27 Jun 2000 18:03:30 +0200


> Right now the Python list is a little slow (at least for me) so I
> appreciate cc:s directly to me.
Same for me: All python lists take hours to distribute the mails.

> > Someone (I don't remember who) mentioned in the discussion
> > about my proposal that one should use SHDeleteKey for recursive
> > deletion of keys. See the MSDN docs on RegDeleteKey for details.
> > Don't know if this is exposed by the lowlevel module.
>
> Don't think so.
The tricky thing is: Deletion of keys behaves differently
on Win95/98 and NT/2000.
(Quoting MSDN:)
The RegDeleteKey function deletes a subkey.

Windows 95/98: The function also deletes all subkeys and values. To delete a
key only if the key has no subkeys or values, use the SHDeleteEmptyKey
function.

Windows NT/2000: The subkey to be deleted must not have subkeys. To delete a
key and all its subkeys, you need to recursively enumerate the subkeys and
delete them individually. To recursively delete keys, use the SHDeleteKey
function.
(end quote)

The SHDelete* funtions require version 4.71 of shlwapi.dll, which
is included in Win98 or 2000 (or in IE 4.0).

>
> > Currently it goes like this, because win32api and winreg (which
> > will soon be _winreg) have slightly different apis, but it will
> > doubtlessly be solved:
>
> Ouch. I don't know if I have time to figure out all of the
> correspondances. Are the only differences those four method names or are
> those the only four differences that DistUtils happened to care about.
> I'm not interested in 1.5 compatibility if it will take a lot of work.
So you should simply ignore this. We will work it out on distutils.

Thomas
(I will disappear soon for holidays)