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 benjamin.peterson, brett.cannon, exarkun
Date 2009-06-12.15:47:17
SpamBayes Score 2.6704776e-09
Marked as misclassified No
Message-id <1244821638.54.0.356637064352.issue4182@psf.upfronthosting.co.za>
In-reply-to
Content
Perhaps the C implementation should interpret the stacklevel parameter
differently so that it is compatible with the Python implementation. 
The stacklevel value is, after all, a very important part of the
interface of warnings.warn, as it is the only way to direct the warning
at a piece of code.

If the C implementation doesn't add a frame to the stack, then maybe it
should special case stacklevel=0 (eg, pointing somewhere arbitrary, not
real, and obviously so).  It seems that it already accounts for this
fact for other stacklevel values, as it doesn't exhibit the obvious
off-by-one error one might expect.

Or, close this ticket as won't-fix, if there is no intention of ever
fixing it.
History
Date User Action Args
2009-06-12 15:47:18exarkunsetrecipients: + exarkun, brett.cannon, benjamin.peterson
2009-06-12 15:47:18exarkunsetmessageid: <1244821638.54.0.356637064352.issue4182@psf.upfronthosting.co.za>
2009-06-12 15:47:17exarkunlinkissue4182 messages
2009-06-12 15:47:17exarkuncreate