[Python-Dev] Possible issue in warnings.py
Benjamin Peterson
musiccomposition at gmail.com
Sun Sep 21 23:17:31 CEST 2008
On Sun, Sep 21, 2008 at 4:26 PM, Scott David Daniels
<Scott.Daniels at acm.org> wrote:
> Does someone who knows the design of warnings.py a bit better than I
> know whether it would be an improvement to switch from:
>> try:
>> file.write(formatwarning(message, category, filename,
>> lineno, line))
>> except IOError:
>> pass # the file (probably stderr) is invalid
>> # - this warning gets lost.
>
> to:
>> complaint = formatwarning(message, category, filename,
>> lineno, line)
>> try:
>> file.write(complaint)
>> except IOError:
>> pass # the file (probably stderr) is invalid
>> # - this warning gets lost.
>
> on the grounds that you might not want failures in the
> linecache code to behave the same as failures in writing
> the complaint to the target area?
>
> I'm working on a patch where the Idle warnings code seems to
> accidentally escalating warnings into errors, and it looked
> to me like this would accidentally swallow errors getting
> warning context and make them fail silently. The Idle issue
> that I'm fiddling with is that it doesn't take the new
> showwarning call format, and it looked like this should
> possibly be fixed at the same time.
Sounds reasonable. Please file a ticket on the tracker.
--
Cheers,
Benjamin Peterson
"There's no place like 127.0.0.1."
More information about the Python-Dev
mailing list