GNOME Bugzilla – Bug 528758
"import pygtk" breaks on headless machines without X
Last modified: 2010-10-20 23:39:36 UTC
Hi, openembedded.org has a patch for compiling pygtk on headless machines. Currently, it is necessary to have X running when importing gtk for compilation (-> http://sourceforge.net/tracker/index.php?func=detail&aid=1901091&group_id=108118&atid=649652) Regards Rolf
Rolf: can you please include the patch as an attachment to this bug?
Sure, I was just about to attach it. You were just too quick in responding ;-) I guess that leaves good hopes for it to be applied. Thank you for the quick turnaround.
Created attachment 109491 [details] [review] patch from openembedded.org to prevent GUI pop-up
Comment on attachment 109491 [details] [review] patch from openembedded.org to prevent GUI pop-up I'm against this kind of horrendous hacks which checks the presence of variables in the main entry point. But I *am* interested in the use case, why should _init() sometimes not be called?
Hm, I thought it was all in the original report? compilation of anything that does "import pygtk" breaks on a headless machine (working a bit from memory, I can check more carefully tomorrow)
Oh, that should already be solved in 2.12. Can you retry with the latest stable version of PyGTK?
Well, I am not sure it is. I have already fixed the problem in another way in gourmet, but for the sake of this bug, I removed that change and fired off another build. http://launchpadlibrarian.net/14379145/buildlog_ubuntu-hardy-i386.gourmet_0.13.7-1.8_FAILEDTOBUILD.txt.gz Look for "could not open display"
That is against hardy which has a pretty recent pygtk as far as I understand. http://packages.ubuntu.com/python-gtk says 2.12.1 which according to www.pygtk.org is the latest stable release.
That's a bug in ubuntu's package, they're not shipping pygtk without patches. Report this in the ubuntu bug tracker.
That is absolute nonsense. This is not even an official ubuntu package. I created this package *specifically for you* to counterclaim your "that should already be solved in 2.12".
openembedded is not yet up to version 2.12 of pygtk, so I cannot give you an example from openembedded. The above build report certainly suggests this is *not* fixed in 2.12 as you claimed in comment 6.
It doesn't work in Ubuntu 2.12 because they patched that behavior away. It doesn't work in PyGTK 2.8 because the fix was applied later.