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.


--Scott David Daniels
[EMAIL PROTECTED]

_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to