IOError:[Errno 27] File too large

ch.valderanis at gmail.com ch.valderanis at gmail.com
Wed Mar 13 18:35:19 EDT 2013


Dear Steven,

Thank you very much both for your answer and of course your comments. They are taken into account.
I found out that when I touch FILENAME.sub in the command line, I get the same error. So I guess it isn't a problem with the language but rather deeper. I will solve this first before I come back.
Just for completeness:

> Which part of the code fails? Please copy and paste the entire traceback, 
> starting with the line "Traceback (most recent call last)" and ending 
> with the complete error message.
The code is corrected according to your advice:
Here it the error:

Traceback (most recent call last):
  File "createsubmitfiles.py", line 12, in <module>
    newfile=open(newname,'w')
IOError: [Errno 27] File too large: 'FILENAME.sub;'
 
I have changed the actual filename reported by the traceback.
FILENAME.xml does exist before the code is run
FILENAME.sub is not created
FILENAME has a length of 160 characters
I do have space to write all the files in the directory

> Is filestring really a constant string like in the snippet above? Is 
> there any change that it could be an enormous string?
Yes. It is a constant string
 
 
> > I am pretty sure that the files is less than 1kB.
> "Pretty sure"? You need to be 100% certain. We can't tell you whether 
> this is the case or not.
When I do an ls -l before I run the code and after the code has failed, all I see are files with size <1kB.

Makis



More information about the Python-list mailing list