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