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 exarkun
Recipients exarkun
Date 2008-04-27.19:08:51
SpamBayes Score 0.021917598
Marked as misclassified No
Message-id <1209323334.77.0.104236998001.issue2705@psf.upfronthosting.co.za>
In-reply-to
Content
In Python 2.5 and earlier, the `showwarning´ function in the `warnings´
module has this signature:

  def showwarning(message, category, filename, lineno, file=None):

In trunk (and presumably what will become Python 2.6), this has become:

  def showwarning(message, category, filename, lineno, file=None,
line=None):

`showwarning´ is documented as a hook which libraries or applications
may override in order to control how warnings are reported.  The
addition of a new parameter to the function and the change to related
code to call it with an argument for that new parameter means that
libraries and applications which replaced it will not work without
modification on Python 2.6.  Instead, a `TypeError´ will be raised when
a warning is emitted.

I suggest restoring the previous signature for `showwarning´ and adding
a new (perhaps preferred) API for showing a warning with the extra
information available.  It may also make sense to emit a deprecation
warning when an overridden old-style `showwarning´ is found.
History
Date User Action Args
2008-04-27 19:08:55exarkunsetspambayes_score: 0.0219176 -> 0.021917598
recipients: + exarkun
2008-04-27 19:08:54exarkunsetspambayes_score: 0.0219176 -> 0.0219176
messageid: <1209323334.77.0.104236998001.issue2705@psf.upfronthosting.co.za>
2008-04-27 19:08:53exarkunlinkissue2705 messages
2008-04-27 19:08:52exarkuncreate