Message114960
Ł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. |
|
Date |
User |
Action |
Args |
2010-08-26 07:39:56 | flox | set | recipients:
+ flox, barry, brett.cannon, sniffer |
2010-08-26 07:39:55 | flox | set | messageid: <1282808395.91.0.780999145118.issue9572@psf.upfronthosting.co.za> |
2010-08-26 07:39:54 | flox | link | issue9572 messages |
2010-08-26 07:39:54 | flox | create | |
|