[Python-checkins] r86000 - python/branches/py3k/Lib/test/test_fileio.py

Brian Curtin brian.curtin at gmail.com
Sun Oct 31 15:55:32 CET 2010


On Sun, Oct 31, 2010 at 09:20, Nick Coghlan <ncoghlan at gmail.com> wrote:

> On Sun, Oct 31, 2010 at 9:56 AM, brian.curtin
> <python-checkins at python.org> wrote:
> > Author: brian.curtin
> > Date: Sun Oct 31 01:56:45 2010
> > New Revision: 86000
> >
> > Log:
> > Fix ResourceWarning about unclosed file
> >
> >
> > Modified:
> >   python/branches/py3k/Lib/test/test_fileio.py
> >
> > Modified: python/branches/py3k/Lib/test/test_fileio.py
> >
> ==============================================================================
> > --- python/branches/py3k/Lib/test/test_fileio.py        (original)
> > +++ python/branches/py3k/Lib/test/test_fileio.py        Sun Oct 31
> 01:56:45 2010
> > @@ -260,7 +260,6 @@
> >                     # OS'es that don't support /dev/tty.
> >                     pass
> >                 else:
> > -                    f = _FileIO("/dev/tty", "a")
> >                     self.assertEquals(f.readable(), False)
> >                     self.assertEquals(f.writable(), True)
> >                     if sys.platform != "darwin" and \
>
> Doesn't that delete the file object that the next two lines are trying to
> test?
>
> Cheers,
> Nick.


It gets created in the try block above, so the file was being created twice
but deleted once.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-checkins/attachments/20101031/988b3ef6/attachment-0001.html>


More information about the Python-checkins mailing list