develooper Front page | perl.perl5.porters | Postings from March 2018

[perl #132950] Blead Breaks CPAN: Dancer2

Thread Next
From:
James E Keenan via RT
Date:
March 8, 2018 16:24
Subject:
[perl #132950] Blead Breaks CPAN: Dancer2
Message ID:
rt-4.0.24-30507-1520526274-1236.132950-15-0@perl.org
On Thu, 08 Mar 2018 09:45:55 GMT, randir wrote:
> On Wed, 07 Mar 2018 23:21:55 -0800, carlos@carlosguevara.com wrote:
> > It looks like blead broke Dancer2:
> > http://www.cpantesters.org/cpan/report/2a0fd474-224e-11e8-ba18-
> > 97cfe85ef830
> 
> I rather suspect a bug in Dancer2 itself. For me, version 0.201000
> passes tests on blead and version 0.202000 fails t/request.t as far
> back as 5.18. I didn't dig further.

I agree that this is more likely a case where, rather than "blead breaks CPAN", blead exposes sub-optimal code in CPAN.

The relevant code in Dancer2 is this:

#####
    while (my ($name, $value) = each %{$cookies}) {
        $cookies->{$name} = Dancer2::Core::Cookie->new(
            name  => $name,
            value => [split(/[&;]/, $value)]
        );
    }
#####

If $value is undefined within a given cookie -- as it explicitly is in one case (used 3 times) in t/request.t -- then it is not surprising that Dancer2::Core::Cookie->new() would fail.

I have submitted this pull request:
https://github.com/PerlDancer/Dancer2/pull/1437

The p.r. clears up the exception and permits t/request.t to run to conclusion.  Three unit tests fail -- but I think that's due to how the tests are written and I'm leaving it up to the Dancer2 community to figure out how to address that.

I'll leave this ticket open, but I myself am *not* going to mark this as a blocker for 5.28.0.

Thank you very much.
-- 
James E Keenan (jkeenan@cpan.org)

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

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