Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Troubleshooting frozen object in tzinfo_timezone

Reply
Thread Tools

Troubleshooting frozen object in tzinfo_timezone

 
 
Morten
Guest
Posts: n/a
 
      01-30-2007

Hi. Off and on I get a "can't modify frozen object" when working with
the tzinfo_timezone plugin. I've added some debugging in the code to try
and track down what goes wrong:

def tzinfo
RAILS_DEFAULT_LOGGER.debug("TZINFO STATE '#{@tzinfo}' class
#{@tzinfo.class} frozen? #{@tzinfo.frozen?}")
return @tzinfo if @tzinfo
RAILS_DEFAULT_LOGGER.debug("TZINFO ASSIGN TO #{MAPPING[name]}")
begin
@tzinfo = MAPPING[name]
rescue TypeError => type_error
RAILS_DEFAULT_LOGGER.debug("TZINFO TYPE ERROR #{type_error}")
raise type_error
end
RAILS_DEFAULT_LOGGER.debug("TZINFO ASSIGNED TO #{@tzinfo}")
if String === @tzinfo
@tzinfo = TZInfo::Timezone.get(@tzinfo)
MAPPING[name] = @tzinfo
end
@tzinfo
end


When the error occurs, the following makes it to the log:

TZINFO STATE '' class NilClass frozen? false
TZINFO ASSIGN TO Europe/Amsterdam
TZINFO TYPE ERROR can't modify frozen object

Which means, that @tzinfo is nil, and yet, the line

@tzinfo = MAPPING[name]

Causes a TypeError. MAPPING is a hash. I'm mildly confused. Anyone able
to shed some light on what might be the issue or how to dig further into
the problem?

ruby 1.8.4 (2005-12-24) [x86_64-linux]

Thanks.

Morten
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Compiling xpython: No rule to make target `runathana.py', needed by `frozen/frozen.c'. est Python 1 10-11-2010 03:35 AM
Troubleshooting Object Reference Not Set to Instance of an Object =?Utf-8?B?TG9yaSBNY0RvbmFsZA==?= ASP .Net 3 04-10-2004 09:12 PM
Frozen string problem, but I haven't frozen anything? LC Geldenhuys Ruby 5 02-18-2004 08:13 AM
modify a frozen object Elias Athanasopoulos Ruby 0 11-13-2003 05:58 PM
pythoncom - 'module' object has no attribute 'frozen' Paul Python 3 10-18-2003 07:31 AM



Advertisments