Skip Menu |

This queue is for tickets about the Date-Holidays-EnglandWales CPAN distribution.

Report information
The Basics
Id: 56201
Status: resolved
Priority: 0/
Queue: Date-Holidays-EnglandWales

People
Owner: Nobody in particular
Requestors: tom [...] eborcom.com
Cc:
AdminCc:

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



Subject: Date::Holidays::EnglandWales suffers from a 2038 problem
perl -MDate::Holidays::EnglandWales -e 'is_uk_holiday(2038, "06", "01")' Returns: Day too big - 24988 > 24855 Sec too small - 24988 < 74752 Sec too big - 24988 > 11647 Cannot handle date (0, 0, 0, 1, 5, 2038) at /export/home/netbanx/base/usr/lib/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/Time/Piece.pm line 315 This happens with Time::Piece 1.15. With Time::Piece 1.20 I see a different problem: the module thinks every day is a bank holiday: perl -MDate::Holidays::EnglandWales -e 'print "CELEBRATE!\n" if is_uk_holiday(2010, "05", "01")' garbage at end of string in strptime: 2010-5-1 at /export/home/netbanx/base/usr/lib/perl5/5.10.1/i686-linux/Time/Piece.pm line 469. CELEBRATE! The test suite doesn't catch these problems because it only checks that the module compiles. You also might want to add some test cases like this: ok ! is_uk_holiday(2010, 6, 1); ok is_uk_holiday(2010, 12, 27); ok ! is_uk_holiday(2038, 6, 3); Finally, I notice the PREREQ_PM in Makefile.PL contains a hashref with a list of module names instead of the required list of key/value pairs containing module names and minimum required versions (or undef if you don't care about version numbers). Tom
On Thu Apr 01 06:19:20 2010, TOMHUKINS wrote: Show quoted text
> perl -MDate::Holidays::EnglandWales -e 'is_uk_holiday(2038, "06", > "01")' > > Returns: > Day too big - 24988 > 24855 > Sec too small - 24988 < 74752 > Sec too big - 24988 > 11647 > Cannot handle date (0, 0, 0, 1, 5, 2038) at > /export/home/netbanx/base/usr/lib/perl5/site_perl/5.8.8/x86_64-linux- > thread-multi/Time/Piece.pm > line 315
OK, the problem here is actually with Time::Piece rather than Date::Holidays::EnglandWales which simply calls the former with the date it receives. Show quoted text
> The test suite doesn't catch these problems because it only checks > that > the module compiles. You also might want to add some test cases like > this: > > ok ! is_uk_holiday(2010, 6, 1); > ok is_uk_holiday(2010, 12, 27); > ok ! is_uk_holiday(2038, 6, 3);
Fair enough. I've added those tests and will do a new release for this and the PREREQ_PM issue. Thanks for your report. Jason
I'm closing this off as the 2038 "bug" is only a 32bit issue. The fix to it will be handled outside of this module so I'm taking the easy route and saying "someone else's problem" ;)