[issue22298] Lib/warnings.py _show_warning does not protect against being called with a file like object which is closed

2016-11-25 Thread Julius Lehmann-Richter
Julius Lehmann-Richter added the comment: Hey Wolfgang, thank you for the clarification. I would never write such code of course, I stumbled across this with a third-party program. I understand your point of view and I actually agree. I would not have even opened this report if it had

[issue22298] Lib/warnings.py _show_warning does not protect against being called with a file like object which is closed

2016-11-25 Thread Julius Lehmann-Richter
Julius Lehmann-Richter added the comment: 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

[issue22298] Lib/warnings.py _show_warning does not protect against being called with a file like object which is closed

2014-08-29 Thread Julius Lehmann-Richter
New submission from Julius Lehmann-Richter: In Lib/warnings.py the _show_warning function catches IOError with the commented intention to ward against an invalid file: def _show_warning(message, category, filename, lineno, file=None, line=None): Hook to write a warning to a file; replace