#1062: path construction conflicts with py2exe
-------------------------+--------------------------------------------------
  Reporter:  carl        |       Owner:  somebody
      Type:  defect      |      Status:  closed  
  Priority:  minor       |   Milestone:  0.9     
 Component:  ui          |     Version:          
Resolution:  worksforme  |    Keywords:  py2exe  
-------------------------+--------------------------------------------------
Changes (by paul):

  * status:  new => closed
  * resolution:  => worksforme

Old description:

> 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.

New description:

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

 {{{
 #!python

 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:

 {{{
 #!python

 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.

Comment:

 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.

-- 
Ticket URL: <http://svn.dabodev.com/trac/dabo/ticket/1062#comment:1>
Dabo <http://svn.dabodev.com/trac/dabo>
Trac Page for Dabo


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: http://leafe.com/archives/byMID/dabo-dev/[EMAIL PROTECTED]

Reply via email to