On Fri, Feb 13, 2009 at 5:43 PM, Ulrich Petri
<mail@xxxxxx> wrote:
Hm that might be true.
I updated to the latest 1927 build but i can still reproduce the problem even with this stupid simple example:
#--------------------------
import time
import pygame
from pygame.locals import *
pygame.init()
SCREEN = Rect(0, 0, 450, 450)
screen = pygame.display.set_mode(SCREEN.size)
time.sleep(5)
#--------------------------
This still produces the same error (base.so) when run through py2app.
# Fast forward 4 hours since writing the above
I have now stepped through the whole py2app and pygame init code (inside the generated app) and I now believe that this is a problem with either py2app or my system.
Py2app generates a "loader" module for each c extension. This loader basicly loops through sys.path until it finds one that ends in "lib-dynload". For reasons unclear to me the lib-dynload in the sys.path used is the one in my system python rather than in the lib/python2.5 dir inside the app bundle.
However by placing
sys.path.insert(0, os.path.join(base, 'lib', 'python2.5', 'lib-dynload'))
inside the py2app __boot__.py file (base is provided py py2app) I finally got both my sample and the original "problem" working.
So I'm sorry to have "barked up the wrong tree". If I find a more elegant solution to the problem i will post it here.
Bye
Ulrich