Re: [pygtk] Segfault importing gtk within distutils / unittest

2008-06-17 Thread Johannes Wienke

Hi again,

maybe someone can help me if I narrow the problem? I've found out that 
this segfault only occurs if one of my own extension modules that also 
link against gtk is loaded before the gtk import statement. Moreover it 
is unrelated to pyunit or distutils. What could be the problem?


Thanks in advance
Johannes


Am 06/09/2008 06:45 PM schrieb Johannes Wienke:

Hi,

I've programmed a custom distutils command to run my unit tests. The
important part looks like this:

def __runTests(self):
'''
Runs all unit tests found in the folder 'test'.
'''

print --- start run tests

# append the build path to the pythonpath
sys.path.append(self.__buildDir)

# append test path to pythonpath
sys.path.append(os.path.join(os.getcwd(), test))

testFiles = self.__findTestModules()

print --- before load tests

tests = TestLoader().loadTestsFromNames(testFiles)

print --- after load tests

t = TextTestRunner(verbosity = 1)
t.run(tests)

As you can see, I've added a few print statements to explain my problem.

Now a part of my system uses pygtk and is used by one of the unit tests
that are being loaded in the code above. The module using pygtk works
without problem - but not within the unit tests. There I get a
segmentation fault while importing gtk. The import at the top of that
module looks like this:

print --- before import pygtk
import pygtk
print --- after import pygtk
pygtk.require('2.0')
print --- after require
import gtk
print --- after import pygtk

Running the tests I get this output:

--- start run tests
--- before load tests
--- before import pygtk
--- after import pygtk
--- after require
Segmentation fault

What could be the problem? Running python 2.4 on Gentoo Linux with pygtk
2.12.0

Thanks in advance.

Johannes




signature.asc
Description: OpenPGP digital signature
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


[pygtk] Segfault importing gtk within distutils / unittest

2008-06-09 Thread Johannes Wienke
Hi,

I've programmed a custom distutils command to run my unit tests. The
important part looks like this:

def __runTests(self):
'''
Runs all unit tests found in the folder 'test'.
'''

print --- start run tests

# append the build path to the pythonpath
sys.path.append(self.__buildDir)

# append test path to pythonpath
sys.path.append(os.path.join(os.getcwd(), test))

testFiles = self.__findTestModules()

print --- before load tests

tests = TestLoader().loadTestsFromNames(testFiles)

print --- after load tests

t = TextTestRunner(verbosity = 1)
t.run(tests)

As you can see, I've added a few print statements to explain my problem.

Now a part of my system uses pygtk and is used by one of the unit tests
that are being loaded in the code above. The module using pygtk works
without problem - but not within the unit tests. There I get a
segmentation fault while importing gtk. The import at the top of that
module looks like this:

print --- before import pygtk
import pygtk
print --- after import pygtk
pygtk.require('2.0')
print --- after require
import gtk
print --- after import pygtk

Running the tests I get this output:

--- start run tests
--- before load tests
--- before import pygtk
--- after import pygtk
--- after require
Segmentation fault

What could be the problem? Running python 2.4 on Gentoo Linux with pygtk
2.12.0

Thanks in advance.

Johannes





signature.asc
Description: OpenPGP digital signature
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/