Installer Beta3f, and pythoncom, pywintypes

Gordon McMillan gmcm at hypernet.com
Wed Feb 2 16:55:22 EST 2000


Lance Shuler wrote:
> 
> I looked on Gordon's website and the searched Dejanews and haven't found
> the answer yet. So, here goes...
> 
> I am trying to freeze a python code that accesses Excel using Windows
> COM.
> 
> In Beta 3f, I am getting errors that were not present in Beta 3e. In 3f,
> I am getting an error in bindepend that it cannot analyze
> c:\winnt\system32\pythoncom.dll nor c:\winnt\system32\pywintypes.dll. Of
> course these two files don't exist, except in "xxx15.dll" form. Here are
> diffs from the a 3f logfile and a 3e logfile:
> 
> 302,303c300,301
> <  ('pywintypes', 'c:\\winnt\\system32\\pywintypes.dll',
> 'b'),                          --- 3f Builder.log ---
> <  ('pythoncom', 'c:\\winnt\\system32\\pythoncom.dll', 'b'),
> ---
> >  ('pywintypes', 'c:\\winnt\\system32\\pywintypes15.dll',
> 'b'),                      --- 3e Builder.log ---
> >  ('pythoncom', 'c:\\winnt\\system32\\pythoncom15.dll', 'b'),

I'm surprised you got anywhere with this with any release.

The change you are hitting is this:

These dlls have a logical name ("pythoncom"), and a physical 
name ("full/path/to/pythoncom15.dll"). The latter is obtained 
from Windows, not Python. As is typical of Windows calls, 
the case of the name has been destroyed. To enable things 
like MySQL.pyd, in beta3f, I replace the base portion of the 
physical name with the logical name, (otherwise at runtime an 
import of MySQL would get a case mismatch error).

Evidently, somehow Mark hooks "import pythoncom" into a 
load of pythoncom15.dll (possibly through the registry?).

Things you could try:

1) Undo what Mark did.
2) Trick the registry (if that's what he's using).
3) Exclude "pythoncom.dll" and include "pythoncom15.dll".
4) Rename pythoncom15.dll to pythoncom.dll.
5) Some combination of the above.
6) Comment out lines 168-171 of resource.py.

In terms of "fixing" this, I don't know what to do. Case 
sensitive imports on a system that is case insensitive 
combined with strange import hacks make a general solution, 
um, elusive.

> It appears that others have seen this in the newsgroup. My question is
> what is the workaround to put in my ".cfg" file to allow me to continue
> to build the exe correctly? For Windows COM, do I just need to revert to
> Beta 3e?

Commenting out those lines will back out that change. You 
probably want the other changes in 3f.

- Gordon




More information about the Python-list mailing list