遇到在Java中创建JEP子解释器时出现“致命的Python错误”。

huangapple go评论55阅读模式
英文:

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

问题

我在 Windows 10 上用 Java 创建 JEP SubInterpreter 时遇到了以下错误:

致命的 Python 错误:init_sys_streams: 无法初始化 sys 标准流
Python 运行时状态:核心已初始化
OSError: [WinError 6] 句柄无效

然后进程退出。

这个错误不是每次都出现,大约十分之一的时间会发生。

对于这个错误有什么想法吗?

谢谢!

英文:

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

得分: 0

这是由C代码中的freopen()引起的问题,将其替换为fopen()dup2()可以解决。
请参考:https://github.com/ninia/jep/issues/242

英文:

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

huangapple
  • 本文由 发表于 2020年4月10日 21:14:21
  • 转载请务必保留本文链接:https://go.coder-hub.com/61141048.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定