McMillan Installer and wxPython

Hi,

I have trouble packaging wxPython program with McMillan installer. It worked before I made some edit to the program and perhaps installed a new Python and wxPython libraries.

The type error "TypeError: unpack non-sequence" result in file mf.py on line 161. It seems like in mf.py around line 152

                        hskey = win32api.RegOpenKeyEx(hkey, subkeyname, 0, win32con.KEY_READ)
                        val = win32api.RegQueryValueEx(hskey, '')
                        desc = getDescr(val[0])

When val[0] is '2.4.2.4', the call to getDescr() get a "None", and that seems to be the problem.

I have no idea what the code is doing. What's the problem? I tried uninstalling and installing different version of the wxPython a few times and it doesn't seem to help.

The following is the traceback:

checking Analysis
building Analysis because out0.toc non existent
running Analysis out0.toc
Analyzing: C:\Python23\Lib\site-packages\Installer\support\_mountzlib.py
Analyzing: C:\Python23\Lib\site-packages\Installer\support\useUnicode.py
Analyzing: qbplot.pyw
Traceback (most recent call last):
  File "C:\Python23\Lib\site-packages\Installer\Build.py", line 780, in ?
    build(sys.argv[1])
  File "C:\Python23\Lib\site-packages\Installer\Build.py", line 40, in build
    exec open(spec, 'r').read()+'\n'
  File "<string>", line 2, in ?
  File "C:\Python23\Lib\site-packages\Installer\Build.py", line 76, in __init__
    self.__postinit__()
  File "C:\Python23\Lib\site-packages\Installer\Build.py", line 58, in __postinit__
    self.assemble()
  File "C:\Python23\Lib\site-packages\Installer\Build.py", line 146, in assemble

    analyzer.analyze_script(script)
  File "C:\Python23\Lib\site-packages\Installer\mf.py", line 363, in analyze_scr
ipt
    return self.analyze_r('__main__')
  File "C:\Python23\Lib\site-packages\Installer\mf.py", line 283, in analyze_r
    newnms = self.analyze_one(name, nm, imptyp)
  File "C:\Python23\Lib\site-packages\Installer\mf.py", line 317, in analyze_one

    mod = self.doimport(nm, ctx, fqname)
  File "C:\Python23\Lib\site-packages\Installer\mf.py", line 384, in doimport
    mod = director.getmod(nm)
  File "C:\Python23\Lib\site-packages\Installer\mf.py", line 161, in getmod
    fnm, (suffix, mode, typ) = stuff
TypeError: unpack non-sequence

This one worked for me :wink:
http://mcmillan-inc.com/cgi-bin/BTSCGI.py/BTS/editbugs?bugid=73
But u're right, there are many problems packaging Python 2.3 with McMillan.
And even if u get it packed the programm written in wxPython might have
visual differences launched from the McMillan package or directly with a
python call to the .pyc files. For example the gauge normally is green on my
Win XP, from the package it gets dark blue. No idea what is happening there!
Probably the wxPython-.dll included to the package makes different calls to
the window subsystem.
Regards
Oliver

···

-----Ursprüngliche Nachricht-----
Von: Timothy Wu [mailto:huggiepython@graffiti.idv.tw]
Gesendet: Mittwoch, 29. Oktober 2003 09:43
An: wxPython-users@lists.wxwindows.org
Betreff: [wxPython-users] McMillan Installer and wxPython

Hi,

I have trouble packaging wxPython program with McMillan installer. It
worked before I made some edit to the program and perhaps installed a
new Python and wxPython libraries.

The type error "TypeError: unpack non-sequence" result in file mf.py on
line 161. It seems like in mf.py around line 152

                        hskey = win32api.RegOpenKeyEx(hkey, subkeyname,
0, win32con.KEY_READ)
                        val = win32api.RegQueryValueEx(hskey, '')
                        desc = getDescr(val[0])

When val[0] is '2.4.2.4', the call to getDescr() get a "None", and that
seems to be the problem.

I have no idea what the code is doing. What's the problem? I tried
uninstalling and installing different version of the wxPython a few
times and it doesn't seem to help.

The following is the traceback:

checking Analysis
building Analysis because out0.toc non existent
running Analysis out0.toc
Analyzing: C:\Python23\Lib\site-packages\Installer\support\_mountzlib.py
Analyzing: C:\Python23\Lib\site-packages\Installer\support\useUnicode.py
Analyzing: qbplot.pyw
Traceback (most recent call last):
  File "C:\Python23\Lib\site-packages\Installer\Build.py", line 780, in ?
    build(sys.argv[1])
  File "C:\Python23\Lib\site-packages\Installer\Build.py", line 40, in build
    exec open(spec, 'r').read()+'\n'
  File "<string>", line 2, in ?
  File "C:\Python23\Lib\site-packages\Installer\Build.py", line 76, in
__init__
    self.__postinit__()
  File "C:\Python23\Lib\site-packages\Installer\Build.py", line 58, in
__postinit__
    self.assemble()
  File "C:\Python23\Lib\site-packages\Installer\Build.py", line 146, in
assemble

    analyzer.analyze_script(script)
  File "C:\Python23\Lib\site-packages\Installer\mf.py", line 363, in
analyze_scr
ipt
    return self.analyze_r('__main__')
  File "C:\Python23\Lib\site-packages\Installer\mf.py", line 283, in
analyze_r
    newnms = self.analyze_one(name, nm, imptyp)
  File "C:\Python23\Lib\site-packages\Installer\mf.py", line 317, in
analyze_one

    mod = self.doimport(nm, ctx, fqname)
  File "C:\Python23\Lib\site-packages\Installer\mf.py", line 384, in
doimport
    mod = director.getmod(nm)
  File "C:\Python23\Lib\site-packages\Installer\mf.py", line 161, in getmod
    fnm, (suffix, mode, typ) = stuff
TypeError: unpack non-sequence

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org

File "C:\Python23\Lib\site-packages\Installer\mf.py", line 161, in getmod
   fnm, (suffix, mode, typ) = stuff
TypeError: unpack non-sequence

This is a problem that McMillian has with the latest 2.4.2.4 wxPython package making a registry entry. We temporarily patched around the problem by removing the entry from the registry for now. It would be nice if that bug were fixed. :slight_smile:

You might want to CC the McMillian list/support as well, as I /think/ the bug should be handled on that end. Not entirely sure though.

-Shane Holloway

Oliver Walczak wrote:

This one worked for me :wink:
HOAX.COM: unravelling the truth from fiction, past to present...
But u're right, there are many problems packaging Python 2.3 with McMillan.
And even if u get it packed the programm written in wxPython might have
visual differences launched from the McMillan package or directly with a
python call to the .pyc files. For example the gauge normally is green on my
Win XP, from the package it gets dark blue. No idea what is happening there!
Probably the wxPython-.dll included to the package makes different calls to
the window subsystem.
Regards
Oliver

As for the visual differences, we found that including a <yourapp>.exe.manifest file mimicking the pythonw.exe.manifest fixes the problem.

-Shane Holloway

Dear Shane,
Could you please explain that a little bit closer? I didn't meet any
.manifest files yet and i don't know where to include..
Thank you
Oliver

···

-----Ursprüngliche Nachricht-----
Von: Shane Holloway (IEEE) [mailto:shane.holloway@ieee.org]
Gesendet: Mittwoch, 29. Oktober 2003 18:02
An: wxPython-users@lists.wxwindows.org
Betreff: Re: AW: [wxPython-users] McMillan Installer and wxPython

Oliver Walczak wrote:

This one worked for me :wink:
HOAX.COM: unravelling the truth from fiction, past to present...
But u're right, there are many problems packaging Python 2.3 with
McMillan. And even if u get it packed the programm written in wxPython
might have visual differences launched from the McMillan package or
directly with a python call to the .pyc files. For example the gauge
normally is green on my Win XP, from the package it gets dark blue. No
idea what is happening there! Probably the wxPython-.dll included to
the package makes different calls to the window subsystem. Regards
Oliver

As for the visual differences, we found that including a
<yourapp>.exe.manifest file mimicking the pythonw.exe.manifest fixes the
problem.

-Shane Holloway

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org

Oliver Walczak wrote:

And even if u get it packed the programm written in wxPython might have
visual differences launched from the McMillan package or directly with a
python call to the .pyc files. For example the gauge normally is green on my
Win XP, from the package it gets dark blue. No idea what is happening there!
Probably the wxPython-.dll included to the package makes different calls to
the window subsystem.

Could it be the difference of using the XP Themes or not? The themes won't be activated for an app by default, you need to either include some magic garbage in the .exe's resources, set it in the registry by editing the properties in the file's right-click explorer menu, or placing a manifest file in the same dir as the .exe. The wxPython installer adds a manifest file for python.exe and pythonw.exe, but you need to create your own (or just copy/rename an existing one) for Installer or py2exe bundles.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Oliver Walczak wrote:

Dear Shane,
Could you please explain that a little bit closer? I didn't meet any
.manifest files yet and i don't know where to include..
Thank you
Oliver

Oliver,
     I found the file under c:\Python23\pythonw.exe.manifest, but since it's so small, I'll just include the text of it here.

-Shane

---pythonw.exe.manifest---

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
     version="0.64.1.0"
     processorArchitecture="x86"
     name="Controls"
     type="win32"
/>
<description>Python Interpreter</description>
<dependency>
     <dependentAssembly>
         <assemblyIdentity
             type="win32"
             name="Microsoft.Windows.Common-Controls"
             version="6.0.0.0"
             processorArchitecture="X86"
             publicKeyToken="6595b64144ccf1df"
             language="*"
         />
     </dependentAssembly>
</dependency>
</assembly>

Thanks, this works wonderfully. =)

Oliver Walczak wrote:

···

This one worked for me :wink:
HOAX.COM: unravelling the truth from fiction, past to present...
But u're right, there are many problems packaging Python 2.3 with McMillan.
And even if u get it packed the programm written in wxPython might have
visual differences launched from the McMillan package or directly with a
python call to the .pyc files. For example the gauge normally is green on my
Win XP, from the package it gets dark blue. No idea what is happening there!
Probably the wxPython-.dll included to the package makes different calls to
the window subsystem.
Regards
Oliver