[Pydev-code] [PATCH] Allow to configure an interpreter even if the workspace path name contains spa
Brought to you by:
fabioz
|
From: Felix S. <fel...@os...> - 2008-05-11 23:38:04
|
Hi, initially I just wanted to fix an annoying NPE but then I stumbled across bug 1523582 [1]. For some reason which is still unknown to me the parameter string (although quoted correctly by pydev) does not make it to python. To be more exact, the string gets through but the quoting is missing so Python complains that it can't find the script file which is used to detect Python's library directories. This is not bound to path names which contain spaces, a command line like 'python -c "import sys; print sys.path"' doesn't work either (syntax error after "import"). I always Fortunately the solution is quite easy: Do not munge the command line parameters (which are available as a String[]) into a String but pass them as String[]. If you do this, there is no problem as the command line parameters will not be split (getRuntime().exec is not a shell). Generally speaking it is much better (safer) not to munge parameters but just to pass them to the exec call. With the patch attached I can launch Eclipse and configure the Python interpreter. Without the patch I always the error described in [1]. The code has be cleaned up a bit but I was not sure what coding style etc. you guys prefer. Furthermore I did not get the tests to run (some setup problem on my side) so maybe I broke something. happy hacking, [1]http://sourceforge.net/tracker/index.php?func=detail&aid=1523582&group_id=85796&atid=577329 -- Felix Schwarz Dipl.-Informatiker Gubener Str. 38 10243 Berlin Germany www.schwarz.eu - software development and consulting |