Bug 64597 - Unset PYTHONPATH when shelling to operating system.
Summary: Unset PYTHONPATH when shelling to operating system.
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: framework (show other bugs)
Version: 4.0.1.2 release
Hardware: Other All
: medium normal
Assignee: Not Assigned
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-14 18:17 UTC by Dave Richards
Modified: 2013-05-15 07:47 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Dave Richards 2013-05-14 18:17:39 UTC
When LO shells to the operating system as it does when you use the various functions to attach the document to email; PYTHONPATH should not be passed to the child process.  I believe this change was made for the new .ui screens which expect to use the internal python included with LO. 

If anything with python is calling in these shells, it won't run as expected and is very hard to troubleshoot.  PYTHONPATH overrides the expected behavior of software used to attach files to email systems and/or the email software itself.
Comment 1 Stephan Bergmann 2013-05-15 07:47:14 UTC
Whenever PyUNO is instantiated in-process, prependPythonPath (pyuno/source/loader/pyuno_loader.cxx) adds the content of the PYUNO_LOADER_PYTHONPATH bootstrap variable from the pythonloader.uno ini file (program/pythonloader.unorc on Linux) to the PYTHONPATH environment variable.  (PYUNO_LOADER_PYTHONHOME is handled similarly, but it calls Py_SetPythonHome instead of setting the PYTHONHOME environment variable.  There appears to be no similar Python function to modify the pythonpath, though.)

What would be necessary is coordination between pyuno_loader.cxx and all the places that spawn external processes (hopefully all using the com.sun.star.system.SystemShellExecute UNO service implemented in shell/source/{unix,win32}), to make sure the PYTHONPATH environment variable is back in its original state for any spawned processes.

(A simple way to see this problem on Linux is to have a shell script containing just

  set

and calling it from Basic with the System function, seeing the output in the shell from which soffice was started.)


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.