本文介绍了对OSError进行故障排除:pty设备不足的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有时在调用pty.openpty()
时会收到OSError异常,并显示消息"pty设备不足"(这是在我的脚本实例同时运行时发生的).
From time to time I'm getting an OSError exception with the message 'out of pty devices' when calling pty.openpty()
(it's happening when a bunch of instances of my scripts run concurrently).
我要达到的极限是多少?我该如何解决?
What is the limit that I'm hitting? How can I get around this?
CentOS 5.6,Python 2.4
CentOS 5.6, Python 2.4
推荐答案
在我的Ubuntu Linux中,最大打开数量为:
In my Ubuntu Linux, the max number of open ptys is given by:
cat /proc/sys/kernel/pty/max
此值可在以下位置配置:
This value is configurable in:
/etc/sysctl.conf
所有这些信息以及更多信息可以在以下网址找到:
All this info, and much more can be found in:
man pty
这篇关于对OSError进行故障排除:pty设备不足的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!