Python导致:IOError:[Errno 28]设备上没有剩余空间:'../results/32766.html'磁盘上有很多空间 [英] Python causing: IOError: [Errno 28] No space left on device: '../results/32766.html' on disk with lots of space

查看:989
本文介绍了Python导致:IOError:[Errno 28]设备上没有剩余空间:'../results/32766.html'磁盘上有很多空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行导致上述错误的Python脚本。不寻常的是这个脚本运行在不同的机器上,并没有任何问题。

不同的是,在机器上,这是造成我写的问题外部硬盘。为了使事情变得更加怪异,这个脚本已经在问题机器上运行,并且已经写了超过三万个文件。

一些相关信息(导致错误的代码):

  nPage = 0 
while nPage!= -1:
for data in:
if len(d.contents)> 1:
如果'< script'in str(d.contents):
l = str(d.contents [1])$ ​​b $ b start = l.find('http://' )
end = l.find('>',start)
out = get_records.openURL(l [start:end])
打印COUNT

与打开('../ results /'+ str(COUNT)+'。html','w')为f:
f.write(out)
COUNT + = 1

nPage = nextPage(mOut,False)

我正在写的目录:

  10:32 @ lorax:〜/ econ / estc / bin $ ll ../ 
总计56
drwxr-xr-x 3 boincuser boincuser 4096 2011-07-31 14:29 ./
drwxr-xr-x 3 boincuser boincuser 4096 2011-07-31 14:20 ../
drwxr-xr -x 2 boincuser boincuser 4096 2011-08-09 10:38 bin /
lrwxrwxrwx 1 boincuser boincuser 47 2011-07-31 14:21结果 - > / media / cavalry / server_backup / econ / estc / results //
-rw -r - r-- 1 test.html


$ b

证明有足够的空间:

pre $ code > 10:38 @ lorax:〜/ econ / estc / bin $ df -h
文件系统大小已用可用使用百分比挂载
/ dev / sda1 9.0G 5.3G 3.3G 63%/
无495M 348K 495M 1%/ dev
无500万164K 500M 1%/ dev / shm
无500万340K 500M 1%/无功/ $运行$ b $无500万0 500万0%/无功/锁
无9.0G 5.3G 3.3G 63%/ var / lib / ureadahead / debugfs
/ dev / sdc10 466G 223G 244G 48%/ media / cavalry

有些事情我已经试过了:


  • 更改路径
  • 重新启动机器

  • 卸载并重新安装驱动器


解决方案

事实证明,我在这里的最佳解决方案是重新格式化驱动器。一旦重新格式化,所有这些问题不再成为问题。


I am running a Python script that is causing the above error. The unusual thing is this script is running on a different machine and is having no problems.

The difference is that on the machine that is causing the problems I am writing to an external hard drive. To make things even weirder this script has run on the problem machine and already written over 30,000 files.

Some relevant information (The code that is causing the error):

nPage = 0
while nPage != -1:
    for d in data:
        if len(d.contents) > 1:
            if '<script' in str(d.contents):
                l = str(d.contents[1])
                start = l.find('http://')
                end = l.find('>',start)
                out = get_records.openURL(l[start:end])
                print COUNT

                with open('../results/'+str(COUNT)+'.html','w') as f:
                    f.write(out)
                COUNT += 1

    nPage = nextPage(mOut,False)

The directory I'm writing to:

10:32@lorax:~/econ/estc/bin$ ll ../
total 56
drwxr-xr-x 3 boincuser boincuser  4096 2011-07-31 14:29 ./
drwxr-xr-x 3 boincuser boincuser  4096 2011-07-31 14:20 ../
drwxr-xr-x 2 boincuser boincuser  4096 2011-08-09 10:38 bin/
lrwxrwxrwx 1 boincuser boincuser    47 2011-07-31 14:21 results -> /media/cavalry/server_backup/econ/estc/results//
-rw-r--r-- 1 boincuser boincuser 44759 2011-08-09 10:32 test.html

Proof there is enough space:

10:38@lorax:~/econ/estc/bin$ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1             9.0G  5.3G  3.3G  63% /
none                  495M  348K  495M   1% /dev
none                  500M  164K  500M   1% /dev/shm
none                  500M  340K  500M   1% /var/run
none                  500M     0  500M   0% /var/lock
none                  9.0G  5.3G  3.3G  63% /var/lib/ureadahead/debugfs
/dev/sdc10            466G  223G  244G  48% /media/cavalry

Some things I have tried:

  • Changing the path of the write to the direct location instead of going through the link
  • Rebooting the machine
  • Unmounting and re-mounting the drive

解决方案

It turns out the best solution for me here was to just reformat the drive. Once reformatted all these problems were no longer problems.

这篇关于Python导致:IOError:[Errno 28]设备上没有剩余空间:'../results/32766.html'磁盘上有很多空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆