Bugzilla – Bug 4245
our python modules shouldn't replace the system ones
Last modified: 2012-12-07 10:11:03
You need to
before you can comment on or make changes to this bug.
Currently we put our python path as the first one in sys.path. This has several
a) We override the system modules, providing a different implementation than
the system expects. This will eventually cause crashes.
b) The module actually loaded is unpredictable. If the module gets loaded
before we modify sys.path, then we get the system version. If it gets loaded
later then we get our version. Since we don't know what other imports will
load, the module actually loaded is somewhat random.
Putting our path at the end would mostly solve these issues. A portion of b)
still remains though:
c) Our code can't be sure we loaded our version of a module.
Solving this is non-trivial though...
The best idea so far is to move everything into a new namespace (e.g. under the
"thinlinc" module). This will allow us to load our versions without conflicting
with the system ones.
One potential problem though is that complex modules (e.g. Cheetah) do internal
imports. We need to check that these work properly if we start moving things