ryantam626 / jupyterlab_code_formatter

A JupyterLab plugin to facilitate invocation of code formatters.
MIT License
822 stars 52 forks source link

importing rpy2.robjects leaks LD_LIBRARY_PATH to kernels #337

Open mlucool opened 3 weeks ago

mlucool commented 3 weeks ago

https://github.com/ryantam626/jupyterlab_code_formatter/blob/master/jupyterlab_code_formatter/formatters.py#L13 has a side effect of modifying the environment to include R_LD_LIBRARY_PATH and R_JAVA_LD_LIBRARY_PATH. Since this is in the parent process, it means all kernels also have this set unintentionally. While explicit clearing of this is possible on a per kernel basis, it's not always easy to do. Can we somehow isolate this change?

P. S. @ryantam626 I see https://github.com/ryantam626/jupyterlab_code_formatter/commit/ed91624481129e8fe54acbb7481e4b35309bcaae, maybe we can move this to jupyterlab-contrib?