Environment variables in introspected modules




Hi,

I've noticed a subtle issue that is happening in recent
versions of PyGObject.

My app has a "standalone" mode on which I avoid having
to install the GSettings schema system-wide by calling
glib-compile-schemas on a local folder and adding such
folder to XDG_DATA_DIRS via os.environ.

This works fine in Ubuntu Oneiric (PyGObject 3.0.0),
but recently stopped working in Precise (currently,
PyGObject 3.1.93). Now it's only working if I modify
os.environ before I do "from gi.repository import Gio".
Otherwise I get "schema not installed" errors.

So a reasonable conclusion is that now introspected
modules are keeping the environment variables they had
the first time they are loaded.

Is there any way I can work around this? My app
unfortunately needs to do some things with Gio before
being able to modify os.environ.

Thanks for any help!


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]