GNOME Bugzilla – Bug 748198
draw event never happens inside virtualenv
Last modified: 2016-06-07 08:00:30 UTC
If 'gi' is a symlink (a common thing to do in virtualenv). Everything seems to work as normal, except the draw events never happen. The following program shows the issue https://gist.github.com/stuaxo/c453c759fadc8d615490 # output outside virtualenv, using 'gi' [OK] $ python no_draw_if_gi_is_symlink.py using gi Draw Draw # create a virtualenv using '--site-packages' [OK] $ virtualenv env1 --system-site-packages $ . env1/bin/activate.sh $ python no_draw_if_gi_is_symlink.py using gi Draw Draw $ deactivate # create a virtualenv and symlink in 'gi' .. [FAIL] $ virtualenv env2 $ . env2/bin/activate.sh $ pushd $VIRTUAL_ENV/lib/python2.7/site-packages $ ln -si /usr/lib/python2.7/dist-packages/gi $ popd $ python no_draw_if_gi_is_symlink.py using gi ^^ No 'Draw' !!! $ deactivate
You're missing a pushd $VIRTUAL_ENV/lib/python2.7/ ln -s ln -s /usr/lib/pymodules/python2.7/cairo/ popd No idea why this results in the missing signal and no error message.
That works ... it would be really good if pygobject could raise ImportError: No module named cairo if anything that needs cairo is called, and it's not accessible for some reason.
Created attachment 329177 [details] [review] Print exception if marshalling a signal argument fails. For example if cairo support is missing, a Gtk.Widget::draw call will result in "TypeError: Couldn't find foreign struct converter for 'cairo.Context'"