bug in file.write() ?

Patrick Useldinger pu at vo.lu
Fri Aug 1 00:43:34 CEST 2003


Hi,

I think I found a bug in the write method of file objects. It seems as
if before writing each block, a check was done in order to verifiy
that there is enough space left for the *whole* file, not for the
*remaining* data to be written.

It happens both under 2.3 and 2.2.3.
Any ideas? 

========================== Python 2.3
==================================
I:\My Programs\dfc>b2

start dfc.py [v.0.19.final (July 31st, 2003)] @ 2003-08-01 00:21:48
Python 2.3.final running on win32
reading configuration file dfcCfgBackupCd
instantiating processor(s) .
paths & includes/excludes taken from configuration file
creating initial reference point i:\dfc\ref\dfcRefBackupCd.dfc
.copying  i:\dfc\arc\dfcArchive cheetah 20030731-234648 F.zip to
f:\dfcArchive cheetah 20030731-234648 F.zip
Traceback (most recent call last):
  File "I:\My Programs\dfc\dfc.py", line 199, in ?
    dfc.doProcess(cfgFile.DFCProcTags)
  File "I:\My Programs\dfc\dfc.py", line 144, in doProcess
    newStat=self.newStat.get(fileName,None)) == None:
  File "I:\My Programs\dfc\dfc.py", line 129, in process
    return self.pubSub.publishMessage(self.pubSubProcess,kwargs,checkRet=True)
  File "I:\My Programs\dfc\PubSub.py", line 170, in publishMessage
    retVal.append(subscriber(**dict(args)))
  File "I:\My Programs\dfc\dfcProcCopy.py", line 20, in process
    shutil.copyfile(fileName,toFile)
  File "C:\Python23\lib\shutil.py", line 39, in copyfile
    copyfileobj(fsrc, fdst)
  File "C:\Python23\lib\shutil.py", line 24, in copyfileobj
    fdst.write(buf)
IOError: [Errno 28] No space left on device

I:\My Programs\dfc>dir f:
 Volume in drive F is Backup 01
 Volume Serial Number is E2CB-1650

 Directory of F:\

18/05/2002  15:39       <DIR>          .
18/05/2002  15:39       <DIR>          ..
01/08/2003  00:25          299.630.592 dfcArchive cheetah
20030731-234648 F.zip
               1 File(s)    299.630.592 bytes
               2 Dir(s)     299.636.736 bytes free

========================= Python 2.2.3
=================================

I:\My Programs\dfc>i:\py222\python.exe dfc.py dfcCfgBackupCd

start dfc.py [v.0.19.final (July 31st, 2003)] @ 2003-08-01 00:29:08
Python 2.2.3.final running on win32
reading configuration file dfcCfgBackupCd
instantiating processor(s) .
paths & includes/excludes taken from configuration file
creating initial reference point i:\dfc\ref\dfcRefBackupCd.dfc
.copying  i:\dfc\arc\dfcArchive cheetah 20030731-234648 F.zip to
f:\dfcArchive cheetah 20030731-234648 F.zip
Traceback (most recent call last):
  File "dfc.py", line 199, in ?
    dfc.doProcess(cfgFile.DFCProcTags)
  File "dfc.py", line 144, in doProcess
    newStat=self.newStat.get(fileName,None)) == None:
  File "dfc.py", line 129, in process
    return self.pubSub.publishMessage(self.pubSubProcess,kwargs,checkRet=True)
  File "PubSub.py", line 170, in publishMessage
    retVal.append(subscriber(**dict(args)))
  File "dfcProcCopy.py", line 20, in process
    shutil.copyfile(fileName,toFile)
  File "i:\py222\lib\shutil.py", line 30, in copyfile
    copyfileobj(fsrc, fdst)
  File "i:\py222\lib\shutil.py", line 20, in copyfileobj
    fdst.write(buf)
IOError: [Errno 28] No space left on device
========================================================================




More information about the Python-list mailing list