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 Julius.Lehmann-Richter
Recipients Julius.Lehmann-Richter, brett.cannon, mhammond, pitrou, terry.reedy, wolma
Date 2016-11-25.09:33:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1480066430.36.0.982804704909.issue22298@psf.upfronthosting.co.za>
In-reply-to
Content
Hey Wolfgang,

thank you for looking into this old one again ;)

The argument you are making does not answer the original bug report though as far as I can see.

My initial problem was not the AttributeError about the missing write but a ValueError (I/O operation on closed file).

Also this seems to have started a discussion about good programming practice between Terry and Antoine, my initial argument though was that, when you are catching an IOError for an invalid file, why not catch the ValueError for the closed file (since a closed file is surely not a valid target for a write operation).

I would really like to be educated on this if I am missing something, why does the argument for not silencing errors and expecting good programming practice apply to the ValueError of a closed standard error which has not been set to None but not to an IOError of a passed in file object?

Cheers Julius
History
Date User Action Args
2016-11-25 09:33:50Julius.Lehmann-Richtersetrecipients: + Julius.Lehmann-Richter, mhammond, brett.cannon, terry.reedy, pitrou, wolma
2016-11-25 09:33:50Julius.Lehmann-Richtersetmessageid: <1480066430.36.0.982804704909.issue22298@psf.upfronthosting.co.za>
2016-11-25 09:33:50Julius.Lehmann-Richterlinkissue22298 messages
2016-11-25 09:33:49Julius.Lehmann-Richtercreate