# Subprocess call in Python interpreter results in memory corruption

**URL:** <https://discourse.slicer.org/t/subprocess-call-in-python-interpreter-results-in-memory-corruption/919>\
**Category:** Support\
**Tags:** python\
**Created:** [August 22, 2017, 1:03pm UTC](https://discourse.slicer.org/t/subprocess-call-in-python-interpreter-results-in-memory-corruption/919 "2017-08-22T13:03:10Z")\
**Posts on this page:** 1\
**Showing post:** 17

<div class="post-metadata">

**Author:** ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)\
**Post date:** [September 6, 2017, 3:23am UTC](https://discourse.slicer.org/t/subprocess-call-in-python-interpreter-results-in-memory-corruption/919/17 "2017-09-06T03:23:01Z")

</div>

Starting with [r26351](http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=26351), a new public API allowing to get the startup environment is available.

- In c++: `qSlicerCoreApplication::startupEnvironment()`
- In python: `slicer.util.startupEnvironment()`

We are still [discussing](https://github.com/Slicer/Slicer/pull/787#issuecomment-327361381) some of the internals but that will not affect the public API.

---

_[View the full topic](https://discourse.slicer.org/t/subprocess-call-in-python-interpreter-results-in-memory-corruption/919)._
