Message114960
| 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: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 | |