develooper Front page | perl.perl5.porters | Postings from April 2015

[perl #124420] [PATCH] $Carp::MaxArgNums off-by-one error

Thread Previous | Thread Next
From:
James E Keenan via RT
Date:
April 30, 2015 00:46
Subject:
[perl #124420] [PATCH] $Carp::MaxArgNums off-by-one error
Message ID:
rt-4.0.18-29893-1430354794-767.124420-15-0@perl.org
On Tue Apr 28 21:16:05 2015, darksuji@gmail.com wrote:
> [NB:  I previously attempted to submit this via perlbug, but something
> seems to have gone wrong.  After not seeing it show up in the RT for
> more than two weeks, I'm trying a different route.  I apologize if
> this is a repeat post.]
> 
> $Carp::MaxArgNums is documented to be the number of arguments to
> display in
> tracebacks, but it has a bug that means that the actual number of
> arguments
> displayed is $MaxArgNums + 1 .  Attached is a patch that fixes the
> behavior,
> improves tests to make the connection between $MaxArgNums and expected
> output
> more obvious, and adds an explanation of how to suppress all arguments
> to the
> documentation.
> 
> Arguably, $Carp::MaxArgNums = 0 should mean 'no arguments' instead of
> 'all
> arguments', but this patch doesn't address that question.  Code that
> depends on
> the incorrect behavior will be broken by this patch, but code that was
> written
> as though the documentation was correct will work more correctly.
> 

I created a branch from blead and applied your patch.  I then ran 'make test' as I customarily do.

I got two failures related to your patch.  One failure detected the fact that while you incremented the version number in Carp.pm, you did not do so in Carp/Heavy.pm.  That was easily fixed.

But the other failures were in dist/Carp/t/Carp.t and were more extensive.  I'm attaching the output.  We cannot proceed with failures like these.

Thank you very much.

-- 
James E Keenan (jkeenan@cpan.org)

---
via perlbug:  queue: perl5 status: new
https://rt.perl.org/Ticket/Display.html?id=124420

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About