[python-win32] Help! [was: Pythonwin vs registry strangeness]

Martin Bless m.bless at gmx.de
Fri Sep 24 14:16:17 CEST 2004


I was wrong. The problems are still there.

Still on WinXP Home, SP2, Python 2.3.4; win32 build 202.

When I start the Debugger (F10) it may happen that immediately 1.200
registry entries like     

#HKEY_CURRENT_USER\Software\Python 2.3\Python for
Win32\ToolbarDebugging-BarNNN

or 

#HKEY_CURRENT_USER\Software\Python 2.3\Python for
Win32\ToolbarDebugging-BarNNN

are created. I had line 467 in debugger.py disabled like this:
    if 0: tb.dialog.SaveState()

So, this obviously doesn't help.

To help myself, I've written this little script that deletes those
erroneous entries. Maybe your interested.

"""Delete problematic registry entries in 'Python for Win32'.

Martin Bless, mb, 2004-09-24, 2004-09-24
No warrenties whatsoever. Use at your own risk.
"""

import win32api
import win32con

subKey = r'Software\Python 2.3\Python for Win32'

if 1:
    #HKEY_CURRENT_USER\Software\Python 2.3\Python for
Win32\ToolbarDebugging-Bar0
    k =
win32api.RegOpenKeyEx(win32con.HKEY_CURRENT_USER,subKey,0,win32con.KEY_ALL_ACCESS)
    nsubkeys,nvalues,timeval = win32api.RegQueryInfoKey(k)
    keys = []
    for i in range(nsubkeys):
        s = win32api.RegEnumKey(k,i)
        if (s.startswith('ToolbarDefault-Bar') or
            s.startswith('ToolbarDebugging-Bar')):
            keys.append(s)
    for i,key in enumerate(keys):
        subKey2 = subKey + '\\' + key
        print i,':', subKey2
        win32api.RegDeleteKey(win32con.HKEY_CURRENT_USER,subKey2)
        if i>99999:
            break
    k.Close()
    print len(keys),"deleted."

What's going on there? 

Hope I'm not alone ...
Have a nice weekend - sad again.

mb - Martin Bless




More information about the Python-win32 mailing list