[weboob] [PATCH] Fixing local_run.py script when no $PYTHONPATH variable was set

Phyks phyks at phyks.me
Wed Oct 12 21:50:00 CEST 2016


As described on IRC, there seems to be an issue when using 
`local_run.py` script to run a Python script that uses Weboob API (as a 
third party library) and when `$PYTHONPATH` is empty.

Typically, on my system, I do not have any `$PYTHONPATH` variable set, 
and was trying to run [this 
through `local_run`, to get the latest modules from development branch 
(because my FreeMobile fix is not yet available in the Weboob updates 
and it was blocking).

Problem was that the `local_run` script was prepending stuff to the 
`$PYTHONPATH` then making it going from undefined, which was "use 
default directories AFAIK" to non empty, but with a single item, which 
was preventing from including any module except the ones from the 
standard library.

I am not 100% sure this is the best fix ever, but using `sys.path` as a 
default value if `$PYTONPATH`, instead of the empty string, fixed the 
issue for me.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-local_run.py-script-when-PYTHONPATH-is-not-set.patch
Type: text/x-diff
Size: 1156 bytes
Desc: not available
URL: <https://lists.symlink.me/pipermail/weboob/attachments/20161012/e50e30f6/attachment.patch>

More information about the weboob mailing list