PythonWin (build 203) for Python 2.3 causes Windows 2000 to grind to a halt?

C

Chris P.

I've been having a problem with PythonWin that seemed to start
completely spontaneously and I don't even know where to START to find
the answer. The only thing I can think of that marks the point
between "PythonWin works fine" and "PythonWin hardly every works fine"
was that I changed the size of my Virtual Paging file, noticing that
it was too small (I currently have a P4 with 1G of RAM). I tried
returning it to its original (smaller) size, but it didn't fix the
problems.

The first time I noticed it, I was using PythonWin and then
right-clicked on My Computer to use "Explore". Instead of the usual
full listing (approx 10 items), I got a mini-listing of 4 items.
Then, after clicking "Explore", I either don't get a new window at all
OR I get a strange file explorer that won't let me look at files,
won't let me copy files, etc. The "mini-lising" thing also happens if
I click the "Start" button while PythonWin is open.

Another problem is trying to open another program while PythonWin is
running - generally, the program will not start, but I also don't get
any kind of error popping up on the screen. My request is just
ignored (although I sometimes get a "system beep".) If I already have
other programs open and then open PythonWin, my menu bar might refuse
to function. Is it significant that, when the menu bar IS working,
the drop-down menu fades in quite slowly, instead of popping up
immediately?

At the end of this message, I've pasted a screen dump of a message I
get when I try to open a file and I've got other apps open (note that
I can have very few, non-memory intensive apps open and I still get
it).

Thanks for any help you can give,

- Chris

[SCREEN DUMP AFTER I TRY TO OPEN A .PY FILE]
File "C:\Python23\Lib\site-packages\pythonwin\pywin\mfc\docview.py",
line 91, in CreateNewFrame
wnd.LoadFrame(self.GetResourceID(), -1, None, context) # triggers
OnCreateClient...
win32ui: LoadFrame failed

win32ui: CreateNewFrame() virtual handler (<bound method
SyntEditTemplate.CreateNewFrame of
<pywin.framework.editor.color.coloreditor.SyntEditTemplate instance at
0x01193F30>>) raised an exception
TypeError: PyCTemplate::CreateNewFrame must return a PyCFrameWnd
object.
 
R

Roger Upole

These look like symptoms of sf bug #1017504
http://sourceforge.net/tracker/index.php?func=detail&aid=1017504&group_id=78018&atid=551954

What version of Pywin32 are you running ?
There's a (semi) fix for this in the latest build.
hth
Roger


Chris P. said:
I've been having a problem with PythonWin that seemed to start
completely spontaneously and I don't even know where to START to find
the answer. The only thing I can think of that marks the point
between "PythonWin works fine" and "PythonWin hardly every works fine"
was that I changed the size of my Virtual Paging file, noticing that
it was too small (I currently have a P4 with 1G of RAM). I tried
returning it to its original (smaller) size, but it didn't fix the
problems.

The first time I noticed it, I was using PythonWin and then
right-clicked on My Computer to use "Explore". Instead of the usual
full listing (approx 10 items), I got a mini-listing of 4 items.
Then, after clicking "Explore", I either don't get a new window at all
OR I get a strange file explorer that won't let me look at files,
won't let me copy files, etc. The "mini-lising" thing also happens if
I click the "Start" button while PythonWin is open.

Another problem is trying to open another program while PythonWin is
running - generally, the program will not start, but I also don't get
any kind of error popping up on the screen. My request is just
ignored (although I sometimes get a "system beep".) If I already have
other programs open and then open PythonWin, my menu bar might refuse
to function. Is it significant that, when the menu bar IS working,
the drop-down menu fades in quite slowly, instead of popping up
immediately?

At the end of this message, I've pasted a screen dump of a message I
get when I try to open a file and I've got other apps open (note that
I can have very few, non-memory intensive apps open and I still get
it).

Thanks for any help you can give,

- Chris

[SCREEN DUMP AFTER I TRY TO OPEN A .PY FILE]
File "C:\Python23\Lib\site-packages\pythonwin\pywin\mfc\docview.py",
line 91, in CreateNewFrame
wnd.LoadFrame(self.GetResourceID(), -1, None, context) # triggers
OnCreateClient...
win32ui: LoadFrame failed

win32ui: CreateNewFrame() virtual handler (<bound method
SyntEditTemplate.CreateNewFrame of
<pywin.framework.editor.color.coloreditor.SyntEditTemplate instance at
0x01193F30>>) raised an exception
TypeError: PyCTemplate::CreateNewFrame must return a PyCFrameWnd
object.
 
C

Chris P.

AWESOME - my life just got THAT much better.

The bug you suggested is exactly the problem that I was having... I
had looked through the bugs being tracked, but the title of that one
didn't jump out at me as something that would help. Thanks!

- Chris

P.S. For anyone reading this group who wants to know exactly what I
did:
1) Uninstall Pywin32
2) Open the registry editor ('regedit' at the command prompt)
3) Go to HKEY_CURRENT_USER\Software\Python[version]\Python for Win32
You will likely find many many many keys that have the format
"ToolbarDefault-Bar#". These keys filling up your registry cause
Windows 2000 to become extremely slow/unstable when Python is running
(especially if your debugger is running.)
4) Delete the keys... I just deleted it at the "Python[version]" root
5) Reinstall Pywin32
 
C

Colin J. Williams

Chris said:
AWESOME - my life just got THAT much better.

The bug you suggested is exactly the problem that I was having... I
had looked through the bugs being tracked, but the title of that one
didn't jump out at me as something that would help. Thanks!

- Chris

P.S. For anyone reading this group who wants to know exactly what I
did:
1) Uninstall Pywin32
2) Open the registry editor ('regedit' at the command prompt)
3) Go to HKEY_CURRENT_USER\Software\Python[version]\Python for Win32
You will likely find many many many keys that have the format
"ToolbarDefault-Bar#". These keys filling up your registry cause
Windows 2000 to become extremely slow/unstable when Python is running
(especially if your debugger is running.)
4) Delete the keys... I just deleted it at the "Python[version]" root
5) Reinstall Pywin32
This is a great workaround but I've found that, with build 203, it needs
to be repeated from time to time.

Colin W.
 
M

Martin Bless

[[email protected] (Chris P.)]
The bug you suggested is exactly the problem that I was having... I
had looked through the bugs being tracked, but the title of that one
didn't jump out at me as something that would help. Thanks!

Yes, using Python24 and the latest win32 build on my machine the bug
still exists. PythonWin works fine if you don't use the debugger.

But since the debugger is the most valuable feature for me I sadly had
to stop using PythonWin. For a while I found some help by running the
script below every now and then. It deletes the erroneous registry
entries. But currently the bugs are stronger.

Here's my solution: I spent some money and switched to "WingIde" from
wingware.com. Wow, it's breathtaking and worth each penny. Don't
compare WingIde with other editors. WingIde really plays in the IDE
(integrated development environment) league. And it's very Python
aware and knowledgable ...

mb - Martin Bless


Here's my script to delete the erroneous debugger entries:

Script "delete-debugger-entries,pywin,python24.py"

#!/usr/bin/env python
# -*- coding: iso-8859-1 -*-

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

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

import win32api
import win32con

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

if 1:
#HKEY_CURRENT_USER\Software\Python 2.4\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."
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,222
Members
46,810
Latest member
Kassie0918

Latest Threads

Top