Closed tbr closed 7 years ago
Hi, Thanks for the report.
I'd prefer to move the call to normalize_path()
in the if cls.__singleton is None
block as the idea was to normalize the environment before creating a framework (therefore, before calling __init__
.
In any case, your version of normalize_path()
will help to avoid the bug: could you make a pull request for the fix, to keep paternity of your code ?
Fixed by #77
Python's sys.path grows each time when calling the
FrameworkFactory.get_framework()
method.This is caused by the call to
normalize_path()
, which (to my opinion), is bugged. Thenormalize_path()
function inserts''
andos.getcwd()
to the sys.path variable, without checking the contents of sys.path and whether cwd is already in sys.path. Thus, sys.path keeps growing over time while using the ipopo framework.The following code fixes
normalize_path()
in framework.py:However, my feeling is also that
FrameworkFactory.get_framework()
shouldn't be callingnormalize_path()
at all. This can be done either inside theif cls.__singleton is None:
block, or maybe even in theFramework.__init__
constructor.