Ticket #1062 (reopened defect)

Opened 5 years ago

Last modified 5 years ago

path construction conflicts with py2exe

Reported by: carl Assigned to: somebody
Priority: minor Milestone: 0.8.3
Component: ui Version:
Keywords: py2exe Cc:

Description (Last modified by paul)

ran an exe built using py2exe on DaboDemo?.py It errored because it could not find an image file. It seem this code

class dApp(dObject):

basepath = os.path.split(dabo.__file__)[0]
img = os.path.join(basepath, "icons", "daboSplashName.png")

normally would create this string:

"p:\dabodev\dabomodule\dabo\icons\daboSplashName.png"

but when run from the exe, it creates:

P:\dabodev\dabodemo\DaboDemo?\dist\library.zip\dabo\icons\daboSplashName.png

which causes:

Traceback (most recent call last):
   File "DaboDemo.py", line 27, in <module>
   File "DaboDemo.py", line 20, in main
   File "dabo\dApp.pyo", line 259, in start
   File "dabo\dApp.pyo", line 220, in setup
   File "dabo\ui\uiwx\__init__.pyo", line 188, in getUiApp
   File "dabo\ui\uiwx\uiApp.pyo", line 107, in __init__
   File "wx\_core.pyo", line 7757, in __init__
   File "wx\_core.pyo", line 7354, in _BootstrapApp
   File "dabo\ui\uiwx\uiApp.pyo", line 157, in OnInit
   File "dabo\ui\uiwx\uiApp.pyo", line 35, in __init__
   File "dabo\ui\uiwx\__init__.pyo", line 1310, in pathToBmp
   File "wx\_core.pyo", line 3270, in ConvertToBitmap
wx._core.PyAssertionError: C++ assertion "image.Ok()" failed at 
..\..\src\msw\bitmap.cpp(799) in wxBitmap::CreateFromImage(): invalid image

I don't know for sure, but I think that string gets passed to a wx component that doesn't know how to dig into the zip.

Change History

07/11/07 21:45:28 changed by paul

  • status changed from new to closed.
  • resolution set to worksforme.
  • description changed.

You need to point py2exe to the dabo icon directory, so it can load it in to the library. See the appwizard output setup.py for an example.

07/11/07 21:47:38 changed by paul

  • status changed from closed to reopened.
  • resolution deleted.

...oops, wait a second. You are reporting something different than what I thought. It looks like the code to get the dabo splash image is doing something its own way, and not taking into account that we could be in a py2exe library. Ticket reopened.