Re: File handle not being released by close

2007-07-31 Thread Gary Duzan
In article <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]> wrote: > > [ ... ] > >for fileName in fileNames: > fileBeginning = os.path.splitext(fileName)[0] > fileEnd = os.path.splitext(fileName)[1] > > if fileEnd == ".py": >print fileName >f=open(fileBeginning+".tmp", 'w') >f.write("

Re: File handle not being released by close

2007-07-30 Thread Jean-Paul Calderone
On Mon, 30 Jul 2007 07:36:00 -0700, [EMAIL PROTECTED] wrote: >Hi, > > [snip] >f=open(fileBeginning+".tmp", 'w') >f.write("Hello") >f.close > You forgot to call close. Try this final line, instead: f.close() Jean-Paul -- http://mail.python.org/mailman/listinfo/python-list

Re: File handle not being released by close

2007-07-30 Thread Peter Otten
[EMAIL PROTECTED] wrote: > I'm in the process of writing some code and noticed a strange problem > while doing so. I'm working with PythonWin 210 built for Python 2.5. I > noticed the problem for the last py file processed by this script, > where the concerned tmp file is only actually written to

Re: File handle not being released by close

2007-07-30 Thread Eric Brunel
On Mon, 30 Jul 2007 16:36:00 +0200, <[EMAIL PROTECTED]> wrote: > Hi, > > I'm in the process of writing some code and noticed a strange problem > while doing so. I'm working with PythonWin 210 built for Python 2.5. I > noticed the problem for the last py file processed by this script, > where the c

Re: File handle not being released by close

2007-07-30 Thread Richard Brodie
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I'm guessing the garbage collector is causing the file to be written, > but shouldn't close do this? Only if you call it ;) -- http://mail.python.org/mailman/listinfo/python-list

File handle not being released by close

2007-07-30 Thread bg_ie
Hi, I'm in the process of writing some code and noticed a strange problem while doing so. I'm working with PythonWin 210 built for Python 2.5. I noticed the problem for the last py file processed by this script, where the concerned tmp file is only actually written to when PythonWin is closed. In