python - 创建信号量时“设备上没有剩余空间”?

标签 python macos filesystems multiprocessing

我最近开始在 Macbook Pro (OS X 10.10) 上使用 Python 观察到以下错误。根据磁盘实用程序,120 GB SSD 驱动器的大约一半仍然可用,所以我怀疑这与磁盘无关,而是与其他文件系统属性有关?

哪些因素控制信号量的可用空间量?我该怎么做才能解决这个问题?

$ python -c 'import multiprocessing; multiprocessing.Semaphore()'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Users/rmcgibbo/miniconda/envs/3.4.2/lib/python3.4/multiprocessing/context.py", line 81, in Semaphore
    return Semaphore(value, ctx=self.get_context())
  File "/Users/rmcgibbo/miniconda/envs/3.4.2/lib/python3.4/multiprocessing/synchronize.py", line 127, in __init__
    SemLock.__init__(self, SEMAPHORE, value, SEM_VALUE_MAX, ctx=ctx)
  File "/Users/rmcgibbo/miniconda/envs/3.4.2/lib/python3.4/multiprocessing/synchronize.py", line 60, in __init__
    unlink_now)
OSError: [Errno 28] No space left on device

(注意,这似乎不依赖于 python 的版本。与 2.7.9 相同的错误)

最佳答案

根据 MacOSX manuals ,用于创建信号量的 sem_open 系统调用可能因 ENOSPC 而失败:

 [ENOSPC]           O_CREAT is specified, the file does not exist, and
                    there is insufficient space available to create the
                    semaphore.

我建议您使用 dtruss 找出 Python 试图在何处创建此信号量。

关于python - 创建信号量时“设备上没有剩余空间”?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28788319/

相关文章:

linux - 在Linux终端中,如何删除目录中除一两个文件外的所有文件

python - 为什么这个脚本不能与线程 python 一起使用

python - 从 int 派生并在 python 类中使用关键字参数

python - 如何在 Python 中制作具有两个不同 Y 轴的绘图

windows - 为什么 Windows 将新创建文件的 "created time"属性设置为旧时间?

linux - 如何恢复在线服务的文件系统快照?

python - 使车牌图像变形为正面平行

javascript - 如何在 OS X 上使用 jsc 运行 JavaScript?

swift - OSX开发,Xib菜单和storyboard Window Controller如何关联?

无法关闭套接字选项 IPV6_V6ONLY