Re: File Closing Problem in 2.3 and 2.4, Not in 2.5 (Final report)

2007-01-10 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Julio Biason wrote: > If I use a file() in a for, how to I explicitely close the file? > > > for line in file('contents'): >print line > > > Would this work like the new 'with' statement or it will only be closed > when the GC finds it? Only when the GC destroys it

Re: File Closing Problem in 2.3 and 2.4, Not in 2.5 (Final report)

2007-01-09 Thread Gabriel Genellina
At Wednesday 10/1/2007 02:36, Julio Biason wrote: [Kinda stealing the thread] (at least a related question!) If I use a file() in a for, how to I explicitely close the file? for line in file('contents'): print line Would this work like the new 'with' statement or it will only be close

Re: File Closing Problem in 2.3 and 2.4, Not in 2.5 (Final report)

2007-01-09 Thread Julio Biason
[Kinda stealing the thread] On Tue, Jan 09, 2007 at 09:05:30PM -0300, Gabriel Genellina wrote: > And do you actually need so many open files simultaneously? > Try to close them explicitely when you finish working on them - do > not rely on GC for closing files. This has *always* been the > recom

Re: File Closing Problem in 2.3 and 2.4, Not in 2.5 (Final report)

2007-01-09 Thread Mark T
"Gabriel Genellina" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > At Tuesday 9/1/2007 20:31, Carroll, Barry wrote: > >>I've spent about a day investigating our "too many open files" error. I >>found the following: >> >> 1. Windows XP allows a Python 2.5 script to open 509

RE: File Closing Problem in 2.3 and 2.4, Not in 2.5 (Final report)

2007-01-09 Thread Gabriel Genellina
At Tuesday 9/1/2007 22:03, Carroll, Barry wrote: The first assumption was correct: the file object is destroyed. The second assumption is apparently incorrect: the file handle is not released when the associated object is destroyed. These 'orphaned' file handles build up and when the OS hand

RE: File Closing Problem in 2.3 and 2.4, Not in 2.5 (Final report)

2007-01-09 Thread Carroll, Barry
Hi, Gabriel, > -Original Message- > From: Gabriel Genellina [mailto:[EMAIL PROTECTED] > Sent: Tuesday, January 09, 2007 4:06 PM > To: python-list@python.org > Subject: RE: File Closing Problem in 2.3 and 2.4, Not in 2.5 (Final > report) > > At Tuesday 9/1/2007 20:

RE: File Closing Problem in 2.3 and 2.4, Not in 2.5 (Final report)

2007-01-09 Thread Gabriel Genellina
At Tuesday 9/1/2007 20:31, Carroll, Barry wrote: I've spent about a day investigating our "too many open files" error. I found the following: 1. Windows XP allows a Python 2.5 script to open 509 concurrent files. And do you actually need so many open files simultaneously?

RE: File Closing Problem in 2.3 and 2.4, Not in 2.5 (Final report)

2007-01-09 Thread Carroll, Barry
John et al: I've spent about a day investigating our "too many open files" error. I found the following: 1. Windows XP allows a Python 2.5 script to open 509 concurrent files. 2. RedHat Fedora Core 1 allows a Python 2.3 script to open 1022 concurrent fi

RE: File Closing Problem in 2.3 and 2.4, Not in 2.5

2007-01-08 Thread Carroll, Barry
John: <<> > > Hi Barry, > > Please always reply on-list if the communication is non-private -- and > meaningful :-) Right. I noticed I hadn't "replied-to-all", so I resent the post to the mailing list. Slip of the mouse, no disrespect intended to the list ;^) > > I don't know; here are som

RE: File Closing Problem in 2.3 and 2.4, Not in 2.5

2007-01-08 Thread Carroll, Barry
> -Original Message- > From: [EMAIL PROTECTED] [mailto:python- > [EMAIL PROTECTED] On Behalf Of John Machin > Sent: Saturday, January 06, 2007 11:09 PM > To: python-list@python.org > Subject: Re: File Closing Problem in 2.3 and 2.4, Not in 2.5 > > Martin v. Löwis w

Re: File Closing Problem in 2.3 and 2.4, Not in 2.5

2007-01-08 Thread John Machin
On 9/01/2007 8:25 AM, Carroll, Barry wrote: >> -Original Message- >> From: [EMAIL PROTECTED] [mailto:python- >> [EMAIL PROTECTED] On Behalf Of John Machin >> Sent: Saturday, January 06, 2007 11:09 PM >> To: python-list@python.org >> Subject: Re: File Cl

Re: File Closing Problem in 2.3 and 2.4, Not in 2.5

2007-01-06 Thread John Machin
Martin v. Löwis wrote: > Carroll, Barry schrieb: > > What I want to know is: > > > > * has anyone else encountered a problem like this, * how was the > > problem corrected, * can the fix be retro-fitted to 2.5 and 2.4? > > From your description, I suspect an error in your code. Your description > i

Re: File Closing Problem in 2.3 and 2.4, Not in 2.5

2007-01-06 Thread rweth
Martin v. Löwis wrote: > Carroll, Barry schrieb: >> What I want to know is: >> >> * has anyone else encountered a problem like this, * how was the >> problem corrected, * can the fix be retro-fitted to 2.5 and 2.4? > > From your description, I suspect an error in your code. Your description > indi

Re: File Closing Problem in 2.3 and 2.4, Not in 2.5

2007-01-05 Thread Martin v. Löwis
Carroll, Barry schrieb: > What I want to know is: > > * has anyone else encountered a problem like this, * how was the > problem corrected, * can the fix be retro-fitted to 2.5 and 2.4? >From your description, I suspect an error in your code. Your description indicates that you don't expect to ha

File Closing Problem in 2.3 and 2.4, Not in 2.5

2007-01-05 Thread Carroll, Barry
Greetings: Please forgive me if this is the wrong place for this post. I couldn't find a more acceptable forum. If there is one, please point me in the right direction. I am part of a small team writing a table-driven automated testing framework for embedded software. The tables, which co