This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author flox
Recipients barry, brett.cannon, flox, sniffer
Date 2010-08-26.07:39:53
SpamBayes Score 6.369123e-05
Marked as misclassified No
Message-id <1282808395.91.0.780999145118.issue9572@psf.upfronthosting.co.za>
In-reply-to
Content
Łukasz,

_closing is not necessary on FileIO instances. The class already declares an __exit__ method which takes care of closing file.

>>> import io
>>> f = io.FileIO('/tmp/test_closing', 'wb')
>>> f.closed
False

>>> f.__exit__()
>>> f.closed
True

Since both IOError and OSError are direct subclasses of EnvironmentError, we can use this in the except clause.
History
Date User Action Args
2010-08-26 07:39:56floxsetrecipients: + flox, barry, brett.cannon, sniffer
2010-08-26 07:39:55floxsetmessageid: <1282808395.91.0.780999145118.issue9572@psf.upfronthosting.co.za>
2010-08-26 07:39:54floxlinkissue9572 messages
2010-08-26 07:39:54floxcreate