Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

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

Report information
The Basics
Id: 20982
Status: resolved
Priority: 0/
Queue: DateTime-TimeZone

People
Owner: Nobody in particular
Requestors: jdhedden [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.46
Fixed in: 0.48



Subject: [PATCH] Localize $SIG{__DIE__} in Local.pm
When using 'die' for flow control out of an eval, you need to localize $SIG{__DIE__} in order to suppress any existing __DIE__ handlers. _find_matching_zoneinfo_file() in Local.pm uses 'die' to exit from a File::Find 'wanted' sub. If a __DIE__ handler exists that alters the 'exception', then this routine fails. The fix is to localizing $SIG{__DIE__}. Attached is a one-line patch for Local.pm to correct this issue: diff -urN DateTime-TimeZone-0.46/lib/DateTime/TimeZone/Local.pm DateTime-TimeZone-fixed/lib/DateTime/TimeZone/Local.pm --- DateTime-TimeZone-0.46/lib/DateTime/TimeZone/Local.pm 2006-05-08 17:42:06.000000000 -0400 +++ DateTime-TimeZone-fixed/lib/DateTime/TimeZone/Local.pm 2006-08-14 08:53:28.000000000 -0400 @@ -137,6 +137,8 @@ local $_; eval { + local $SIG{__DIE__}; # Suppress any existing __DIE__ handler + File::Find::find ( { wanted => sub (This problem arose from a report to me by an Object::InsideOut user. OIO installs __DIE__ handlers to report on uncaught exceptions. These caused DateTime::TimeZone to malfunction.)
Subject: DT-TZ.patch
diff -urN DateTime-TimeZone-0.46/lib/DateTime/TimeZone/Local.pm DateTime-TimeZone-fixed/lib/DateTime/TimeZone/Local.pm --- DateTime-TimeZone-0.46/lib/DateTime/TimeZone/Local.pm 2006-05-08 17:42:06.000000000 -0400 +++ DateTime-TimeZone-fixed/lib/DateTime/TimeZone/Local.pm 2006-08-14 08:53:28.000000000 -0400 @@ -137,6 +137,8 @@ local $_; eval { + local $SIG{__DIE__}; # Suppress any existing __DIE__ handler + File::Find::find ( { wanted => sub
Subject: Re: [rt.cpan.org #20982] [PATCH] Localize $SIG{__DIE__} in Local.pm
Date: Mon, 18 Sep 2006 11:48:12 -0500 (CDT)
To: "Jerry D. Hedden via RT" <bug-DateTime-TimeZone [...] rt.cpan.org>
From: Dave Rolsky <autarch [...] urth.org>
On Mon, 14 Aug 2006, Jerry D. Hedden via RT wrote: Show quoted text
> diff -urN DateTime-TimeZone-0.46/lib/DateTime/TimeZone/Local.pm > DateTime-TimeZone-fixed/lib/DateTime/TimeZone/Local.pm > --- DateTime-TimeZone-0.46/lib/DateTime/TimeZone/Local.pm 2006-05-08 > 17:42:06.000000000 -0400 > +++ DateTime-TimeZone-fixed/lib/DateTime/TimeZone/Local.pm 2006-08-14 > 08:53:28.000000000 -0400 > @@ -137,6 +137,8 @@ > local $_; > eval > { > + local $SIG{__DIE__}; # Suppress any existing __DIE__ handler > + > File::Find::find > ( { wanted => > sub
Thanks, this is fixed in 0.48.