Skip Menu |
 

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

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

Report information
The Basics
Id: 110247
Status: resolved
Priority: 0/
Queue: DateTime-Format-Strptime

People
Owner: Nobody in particular
Requestors: mdorman [...] nvidia.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 1.62



Subject: New version throws error on bad date
Date: Wed, 9 Dec 2015 21:48:59 +0000
To: "bug-datetime-format-strptime [...] rt.cpan.org" <bug-datetime-format-strptime [...] rt.cpan.org>
From: Michael Dorman <mdorman [...] nvidia.com>
Download (untitled) / with headers
text/plain 1.2k
Hey, Dave, Using 1.56, if I run: use strict; use warnings; use DateTime; use DateTime::Format::Strptime; my $parser = DateTime::Format::Strptime->new ( pattern => '%a %b %d %T %Y', time_zone => DateTime->now->time_zone ) or die "Couldn't parse pattern"; my $datetime = $parser->parse_datetime( 'Wed Feb 29 12:02:28 2013' ); I end up with an undefined result---which is unsurprising since it's a nonsensical date. If I run it with 1.61, I get: Can't call method "day_of_week_0" on an undefined value at /home/utils/perl5/perlbrew/perls/5.22.0-007/lib/site_perl/5.22.0/DateTime/Format/Strptime.pm line 760. That seems a little...punitive. Mike. ----------------------------------------------------------------------------------- This email message is for the sole use of the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. -----------------------------------------------------------------------------------
Download (untitled) / with headers
text/plain 125b
This is definitely a bug. This module should never throw exceptions when it can't parse things unless you've asked it do so.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.