I am trying to run and interact with a vendor specific old version of Python (SunGard Arena Python) from a main Python program through Popen, as I need access to a database through the vendor version of Python.
I can run the vendor Python through the shell though I get
'import site' failed; use -v for traceback.
Now when I try to run it through Popen, if I do the standard:
proc = Popen('U:arena_python.exe',bufsize=-1,stdin=PIPE, stdout=PIPE, stderr=STDOUT)
it doesn't work at all and when I do proc.communicate() I get:
('An exception has occurred -- see the traceback log in "acm_.log".\nCreated a minidump in ".\\arena_python-20160216-092027-942.dmp".\n\'import site\' failed; use -v for traceback\n', None)
The log mentions an access violation in C:\windows\SysWOW64\ntdll.dll. Strangely, if I run the above and include a script as a command line argument, the script runs fine before the process crashes again. Playing around, it seems to work better if I run it with the close_fds=True:
Popen('U:arena_python.exe',bufsize=-1,close_fds=True)
But then I don't know how to interact with the process - the documentation says that on Windows you can't use close_fds=True and redirect input/output.
Any idea what is going on? How can I interact with the process? Thank you,