[Sugar-devel] [Dextrose] [PATCH sugar-toolkit] Insert activity root path in front of the reset of sys.path

Sascha Silbe sascha-ml-reply-to-2011-2 at silbe.org
Mon Feb 7 04:40:59 EST 2011


Excerpts from Aleksey Lim's message of Sun Feb 06 01:50:54 +0100 2011:

[Posting only on sugar-devel - please let's discuss general Sugar
development just there, not on dextrose]

> Otherwise it is possible to include, eg, system modules before local ones.

Which is how Python 2 usually works. Your patch would make us deviate
from upstream, making it harder to debug. It might even cause regressions
in existing activities that bundle copies of system modules for use on
older systems. If we prefer the bundled copy over the system one, it
might break on more recent systems. In Restore [1] I'm taking care to
change the name of the file [2] and use it only if the system copy is too
old, but other authors might not have been that careful.

I'd much rather see us mention this in the documentation than
unconditionally messing with the module loading order for all activities.

AFAICT Python 3 prefers local modules over the system ones [4], so this
is only a matter of time resp. of a Py3k / g-i / Gnome3 based Sugar port.

Sascha

[1] http://activities.sugarlabs.org/en-US/sugar/addon/4327
[2] http://git.sugarlabs.org/restore/mainline/blobs/master/zipfile26.py
[3] http://git.sugarlabs.org/restore/mainline/blobs/master/restore.py#line29
[4] http://diveintopython3.org/your-first-python-program.html#importsearchpath
-- 
http://sascha.silbe.org/
http://www.infra-silbe.de/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 494 bytes
Desc: not available
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20110207/7be698c8/attachment-0001.pgp>


More information about the Sugar-devel mailing list