Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #41196

Re: IOError:[Errno 27] File too large

From Dennis Lee Bieber <wlfraed@ix.netcom.com>
Subject Re: IOError:[Errno 27] File too large
Date 2013-03-13 18:27 -0400
Organization > Bestiaria Support Staff <
References <b4fcf481-f673-4004-b145-bbb24864e605@googlegroups.com>
Newsgroups comp.lang.python
Message-ID <mailman.3272.1363213676.2939.python-list@python.org> (permalink)

Show all headers | View raw


On Wed, 13 Mar 2013 09:53:17 -0700 (PDT), ch.valderanis@gmail.com
declaimed the following in gmane.comp.python.general:

> Hi,
> 
> Relatively newcomer here.
> The following code fails with the above error:
> python version used 2.6.2 under linux
> 
> filestring='somestring'
> for files in glob.glob('*'):
> 	f2=open(files.replace('.xml','.sub'),'w')

	"Danger Will Robinson, Danger"

	What do you expect to have happen for files that did NOT have ".xml"
somewhere in the name. If you only want to do this for *.xml you should
probably ask for that in the glob() call.

	Also, the standard library has functions for splitting file names
into prefix and extension...

> 	f2.write(filestring+files)
> 	f2.close()

	<snip> 

> I am pretty sure that the files is less than 1kB. Is there another reason for the operation to fail?
> 
> Any other comments,remarks welcomed. 
>
	Provide the full traceback, so we can confirm what line produced the
error.
-- 
	Wulfraed                 Dennis Lee Bieber         AF6VN
        wlfraed@ix.netcom.com    HTTP://wlfraed.home.netcom.com/

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

IOError:[Errno 27] File too large ch.valderanis@gmail.com - 2013-03-13 09:53 -0700
  Re: IOError:[Errno 27] File too large Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-03-13 17:32 +0000
    Re: IOError:[Errno 27] File too large ch.valderanis@gmail.com - 2013-03-13 15:35 -0700
      Re: IOError:[Errno 27] File too large Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-03-14 02:46 +0000
        Re: IOError:[Errno 27] File too large ch.valderanis@gmail.com - 2013-03-14 13:12 -0700
          Re: IOError:[Errno 27] File too large Dave Angel <davea@davea.name> - 2013-03-14 21:32 -0400
  Re: IOError:[Errno 27] File too large Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-03-13 18:27 -0400

csiph-web