[Georg Brandl] > Hm. This broke a few doctests. I can fix them, but I wonder if > doctest should accept a bare exception name if the exception > is defined in the current module.
No. > Or should it ignore the module name altogether? No. doctest strives to be magic-free WYSIWYG. If someone _intends_ the module name to be optional in a doctest, they should explicitly use doctest's ELLIPSIS option. > (Background: > > In normal exception tracebacks, non-builtin exceptions are printed with > their module name prepended: > > Traceback: > [...] > decimal.InvalidOperation: ... > > When formatted by traceback.format_exception_only, the module name was > omitted, which the patch mentioned above corrected. Since doctest relies > on that behavior, three stdlib doctests broke.) Changes to visible behavior should not be introduced in bugfix releases, unless that happens as an unavoidable consequence of repairing a critical bug, so this should be yanked from 2.4. I agree the traceback formatting inconsistency was a bug, but it was hardly critical (for example, nobody noticed it for 15 years <0.5 wink>). _______________________________________________ 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