I've broken PythonWin2.4 - Dialogs don't pop up!

Michael MichaelMurdock at gmail.com
Wed Apr 6 15:28:05 EDT 2005


I have broken PythonWin and I don't know how or why. It worked great
until recently. I have installed / removed several apps since it worked
last. I could have a virus unknown to my antivirus program, I guess.
I'm stumped.


---------- The Symptoms ---------------------

Here's what happens. I fire up PythonWin without opening a python file.
Everything looks good - the interactive window is at the bottom of the
main dialog and I can type python code into it and it seems to work
fine. But if I select anything from the menu or toolbar that requires a
new dialog box to pop up, either:

1. Nothing happens - it acts like it popped up the dialog, but it's not
there. At least I can't see it.

2. I get an error down in the interactive window

3. I get a windows error telling me that the program is now going to
crash.

4. PythonWin just disappears off my screen - all the processes seem to
die.

Note: Sometimes I can't even get a menu item to respond, but that's not
very often.

--------- Examples -----------------

Example #1. If I select "Edit Python Path" I get the following message
in the interactive window:

>>> Failed to execute command:
from pywin.tools import regedit;regedit.EditRegistry()
Traceback (most recent call last):
  File
"C:\Python24\Lib\site-packages\pythonwin\pywin\framework\toolmenu.py",
line 103, in HandleToolCommand
    exec "%s\n" % pyCmd
  File "<string>", line 1, in ?
  File
"C:\Python24\Lib\site-packages\pythonwin\pywin\tools\regedit.py", line
323, in ?
    template = RegTemplate()
  File
"C:\Python24\Lib\site-packages\pythonwin\pywin\tools\regedit.py", line
245, in __init__
    docview.DocTemplate.__init__(self, win32ui.IDR_PYTHONTYPE, None,
SplitterFrame, None)
  File "C:\Python24\Lib\site-packages\pythonwin\pywin\mfc\docview.py",
line 71, in __init__
    self._SetupSharedMenu_()
  File "C:\Python24\Lib\site-packages\pythonwin\pywin\mfc\docview.py",
line 74, in _SetupSharedMenu_
    sharedMenu = self.GetSharedMenu()
win32ui: The template has no menu


Example #2. If I try to open a file by selecting "open" from the "file"
menu or by hitting the icon on the toolbar, I almost always get the
behavior in which it acts like the File Open dialog box was displayed,
but it's not.

Example #3. If I hit the "?" icon on the toolbar, I get the following
error message:

File "C:\Python24\Lib\site-packages\pythonwin\pywin\framework\app.py",
line 307, in OnHelpAbout
    win32ui.InitRichEdit()
win32ui: AfxInitRichEdit failed
win32ui: Error in Command Message handler for command ID 57664, Code 0

------------- Here's what I know --------------

My Machine:

 + I am on WinXP-Pro using Python 2.4:

 + In the interactive Window this is what is says: PythonWin 2.4 (#60,
Feb  9 2005, 19:03:27) [MSC v.1310 32 bit (Intel)] on win32.

 + The first item in my PATH env variable is: C:\Python24\.

 + From the PythonWin About box: Python 2.4 pywin32 extensions (build
203).

 + In my system registry, In HKEY_LOCAL_MACHINE\SOFTWARE\Python, I have
one entry: PythonCore and it has two sub-entries: 2.3 and 2.4.
Everything looks similar between the two and the registry data for
Python2.4 seems fine:

InstallPath = c:\Python24\
InstallGroup = ActiveState ActivePython2.4
PythonPath = C:\Python24\Lib;C:\Python24\DLLs;C:\Python24\Lib\lib-tk


The only dialog box that always correctly pops up is the About box from
the help menu.

I have Python 2.3 installed in an adjacent directory to my 2.4 version.
I can go down into the Python2.3 directories to PythonWin, which is
actually ver 2.3.4, and fire up PythonWin and I don't have any of these
problems.

After I have a problem with PythonWin2.4 I notice weird UI behavior
from my other apps until I kill PythonWin.


Any ideas?

Thanks,

~Michael.




More information about the Python-list mailing list