Hit "Fatal Python error" while creating JEP SubInterpreter in Java

156 views Asked by At

I got the following error while creating JEP SubInterpreter in Java on Windows 10:

Fatal Python error: init_sys_streams: can't initialize sys standard streams
Python runtime state: core initialized
OSError: [WinError 6] The handle is invalid

And then the process exited.

This error does not occur every time, almost one tenth.

Any idea about this error?

Thanks!

1

There are 1 answers

0
anthonyhu81 On BEST ANSWER

This is caused by freopen() in C code, replace it with fopen() and dup2() could fix it. Please refer to: https://github.com/ninia/jep/issues/242