Skip Menu |

This queue is for tickets about the DateTime-Format-Natural CPAN distribution.

Report information
The Basics
Id: 39844
Status: rejected
Priority: 0/
Queue: DateTime-Format-Natural

People
Owner: Nobody in particular
Requestors: abilleb [...] yahoo.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.73
Fixed in: (no value)



Subject: DateTime::Format::Natural - strange behavior when used with Test::MockObject
I'm seeing some strange behavior when using DateTime::Format::Natural along with Test::MockObject (I haven't seem this when using Test::MockObject with anything else). Here's my test case: ------------------------------- #!/usr/bin/perl use strict; use warnings; use Test::MockObject; use DateTime::Format::Natural; ------------------------------- and here's the output I get: Called UNIVERSAL::can() as a function, not a method at /usr/lib/perl5/site_perl/5.8.8/DateTime/Locale.pm line 298 This becomes problematic for test files that use Test::NoWarnings, for the voluminous warnings produced by the above. I'm using Perl v5.8.8 on Linux 2.6.9-42.ELsmp with: - DateTime.pm v0.4305 (which seems to provide Locale.pm v0.42) - DateTime::Format::Natural v0.73 - Test::MockObject v1.09 Do you see this as being a problem with DateTime::Format::Natural, or with DateTime?
CC: autarch [...] urth.org
Subject: Re: [rt.cpan.org #39844] DateTime::Format::Natural - strange behavior when used with Test::MockObject
Date: Tue, 7 Oct 2008 11:40:46 +0200
To: Andrew Billeb via RT <bug-DateTime-Format-Natural [...] rt.cpan.org>
From: Steven Schubiger <schubiger [...] cpan.org>
Andrew Billeb via RT <bug-DateTime-Format-Natural@rt.cpan.org> wrote: Show quoted text
> Mon Oct 06 17:58:28 2008: Request 39844 was acted upon. > Transaction: Ticket created by abilleb@yahoo.com > Queue: DateTime-Format-Natural > Subject: DateTime::Format::Natural - strange behavior when used with > Test::MockObject > Broken in: 0.73 > Severity: Normal > Owner: Nobody > Requestors: abilleb@yahoo.com > Status: new > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=39844 > > > > I'm seeing some strange behavior when using DateTime::Format::Natural along with > Test::MockObject (I haven't seem this when using Test::MockObject with anything else). > Here's my test case: > > ------------------------------- > #!/usr/bin/perl > > use strict; > use warnings; > > use Test::MockObject; > use DateTime::Format::Natural; > ------------------------------- > > and here's the output I get: > > Called UNIVERSAL::can() as a function, not a method at > /usr/lib/perl5/site_perl/5.8.8/DateTime/Locale.pm line 298 > > This becomes problematic for test files that use Test::NoWarnings, for the voluminous > warnings produced by the above. > > I'm using Perl v5.8.8 on Linux 2.6.9-42.ELsmp with: > - DateTime.pm v0.4305 (which seems to provide Locale.pm v0.42) > - DateTime::Format::Natural v0.73 > - Test::MockObject v1.09 > > Do you see this as being a problem with DateTime::Format::Natural, or with DateTime?
I think, it can be attributed somehow to DateTime, because following code #!/usr/bin/perl use strict; use warnings; use Test::MockObject; use DateTime; does trigger exactly the same warning. Furthermore, when I run the above snippet in the debugger, I see following stack trace output being emitted at compile-time: Called UNIVERSAL::can() as a function, not a method at /usr/local/share/perl/5.8.8/DateTime/Locale.pm line 298 at /usr/local/share/perl/5.8.8/UNIVERSAL/can.pm line 71 UNIVERSAL::can::_report_warning() called at /usr/local/share/perl/5.8.8/UNIVERSAL/can.pm line 54 UNIVERSAL::can::can('DateTime::Locale::en_US', 'new') called at /usr/local/share/perl/5.8.8/DateTime/Locale.pm line 298 DateTime::Locale::_load_class_from_id('DateTime::Locale', 'en_US') called at /usr/local/share/perl/5.8.8/DateTime/Locale.pm line 207 DateTime::Locale::load('undef', 'en_US') called at /usr/local/lib/perl/5.8.8/DateTime.pm line 103 DateTime::DefaultLocale('DateTime', 'en_US') called at /usr/local/lib/perl/5.8.8/DateTime.pm line 113 require DateTime.pm called at dtfn.pl line 7 main::BEGIN() called at /usr/local/lib/perl/5.8.8/DateTime/Infinite.pm line 0 eval {...} called at /usr/local/lib/perl/5.8.8/DateTime/Infinite.pm line 0 I'm CC'ing this bug report to Dave Rolsky (the DateTime author). Steven
CC: Andrew Billeb via RT <bug-DateTime-Format-Natural [...] rt.cpan.org>
Subject: Re: [rt.cpan.org #39844] DateTime::Format::Natural - strange behavior when used with Test::MockObject
Date: Tue, 7 Oct 2008 10:46:59 -0500 (CDT)
To: Steven Schubiger <schubiger [...] cpan.org>
From: Dave Rolsky <autarch [...] urth.org>
On Tue, 7 Oct 2008, Steven Schubiger wrote: Show quoted text
> Called UNIVERSAL::can() as a function, not a method at /usr/local/share/perl/5.8.8/DateTime/Locale.pm line 298 > at /usr/local/share/perl/5.8.8/UNIVERSAL/can.pm line 71 > UNIVERSAL::can::_report_warning() called at /usr/local/share/perl/5.8.8/UNIVERSAL/can.pm line 54 > UNIVERSAL::can::can('DateTime::Locale::en_US', 'new') called at /usr/local/share/perl/5.8.8/DateTime/Locale.pm line 298 > DateTime::Locale::_load_class_from_id('DateTime::Locale', 'en_US') called at /usr/local/share/perl/5.8.8/DateTime/Locale.pm line 207 > DateTime::Locale::load('undef', 'en_US') called at /usr/local/lib/perl/5.8.8/DateTime.pm line 103 > DateTime::DefaultLocale('DateTime', 'en_US') called at /usr/local/lib/perl/5.8.8/DateTime.pm line 113 > require DateTime.pm called at dtfn.pl line 7 > main::BEGIN() called at /usr/local/lib/perl/5.8.8/DateTime/Infinite.pm line 0 > eval {...} called at /usr/local/lib/perl/5.8.8/DateTime/Infinite.pm line 0 > > I'm CC'ing this bug report to Dave Rolsky (the DateTime author).
This is simply a very annoying bug in UNIVERSAL::can where it falsely reports that ->can() was called as a function in some cases. Not much I can do about it. -dave /*============================================================ http://VegGuide.org http://blog.urth.org Your guide to all that's veg House Absolute(ly Pointless) ============================================================*/
Subject: Re: [rt.cpan.org #39844] DateTime::Format::Natural - strange behavior when used with Test::MockObject
Date: Wed, 8 Oct 2008 08:05:02 -0700 (PDT)
To: bug-DateTime-Format-Natural [...] rt.cpan.org
From: Andrew Billeb <abilleb [...] yahoo.com>
Thanks Dave....I'd like to open a bug against UNIVERSAL and include your comments (paraphrased). Would you have any objection to that? Andrew --- On Tue, 10/7/08, autarch@urth.org via RT <bug-DateTime-Format-Natural@rt.cpan.org> wrote: Show quoted text
> From: autarch@urth.org via RT <bug-DateTime-Format-Natural@rt.cpan.org> > Subject: Re: [rt.cpan.org #39844] DateTime::Format::Natural - strange behavior when used with Test::MockObject > To: abilleb@yahoo.com > Date: Tuesday, October 7, 2008, 11:47 AM > <URL: http://rt.cpan.org/Ticket/Display.html?id=39844
> >
> > On Tue, 7 Oct 2008, Steven Schubiger wrote: >
> > Called UNIVERSAL::can() as a function, not a method at
> /usr/local/share/perl/5.8.8/DateTime/Locale.pm line 298
> > at /usr/local/share/perl/5.8.8/UNIVERSAL/can.pm line
> 71
> > UNIVERSAL::can::_report_warning() called at
> /usr/local/share/perl/5.8.8/UNIVERSAL/can.pm line 54
> >
> UNIVERSAL::can::can('DateTime::Locale::en_US', > 'new') called at > /usr/local/share/perl/5.8.8/DateTime/Locale.pm line 298
> >
> DateTime::Locale::_load_class_from_id('DateTime::Locale', > 'en_US') called at > /usr/local/share/perl/5.8.8/DateTime/Locale.pm line 207
> > DateTime::Locale::load('undef',
> 'en_US') called at > /usr/local/lib/perl/5.8.8/DateTime.pm line 103
> > DateTime::DefaultLocale('DateTime',
> 'en_US') called at > /usr/local/lib/perl/5.8.8/DateTime.pm line 113
> > require DateTime.pm called at dtfn.pl line 7 > > main::BEGIN() called at
> /usr/local/lib/perl/5.8.8/DateTime/Infinite.pm line 0
> > eval {...} called at
> /usr/local/lib/perl/5.8.8/DateTime/Infinite.pm line 0
> > > > I'm CC'ing this bug report to Dave Rolsky (the
> DateTime author). > > This is simply a very annoying bug in UNIVERSAL::can where > it falsely > reports that ->can() was called as a function in some > cases. > > Not much I can do about it. > > > -dave > > /*============================================================ > http://VegGuide.org http://blog.urth.org > Your guide to all that's veg House Absolute(ly > Pointless) > ============================================================*/