Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Error with Ruby 1.9.2 - Can't add a new key into hash during iteration

#33

Hi Ian,

Running Pickle with Ruby 1.9.2 and I encountered this error:

can't add a new key into hash during iteration (RuntimeError)
/Users/michaelm/.rvm/gems/ruby-1.9.2-p0/gems/pickle-0.3.5/lib/pickle/session.rb:164:in `[]='

Initially it was with pickle 0.3.5 but it still exists with version 0.4.2. It occurs when I'm using an association (in Session#convert_models_to_attributes) eg:

Then a placement should exist with registration: the registration

Apparently it is a bug/feature with Ruby 1.9.2. I mimicked another person's workaround and it worked, see: http://github.com/remvee/exifr/commit/597f935cb2c251fd2792101fcaf99...

I can submit this change if you want but I wasn't sure whether this method/approach will still be in the new pickle changes you're making.

Cheers,

Michael.

Reported by Michael MacDonald · October 11th, 2010 @ 01:15 AM

State: resolved
Milestone: none
Assigned to: Ian White Ian White

Activity

  1. Ian White
    Ian White

    Hey Michael,

    Thanks for the heads up. New pickle will use orm_adapter for this stuff, and should be out soon, so I'll make sure that a test goes in for this issue.

    Cheers,
    Ian

    October 11th, 2010 @ 04:23 PM

  2. Michael MacDonald
  3. Ben Hutton
    Ben Hutton

    Also hitting this. Any ETA on the fix? Or should I try to hack around it?

    November 3rd, 2010 @ 05:48 PM

  4. Ian White
    Ian White

    Arg, thanks for the nudge. Been busy with life and work. This has been fixed in orm_adapter, but I haven't got pickle using orm_adapter yet.

    I'll port the fix to pickle right now.

    November 4th, 2010 @ 08:13 AM

  5. Ian White
  6. Michael MacDonald
    Michael MacDonald

    Excellent work Ian, thanks! I've upgraded pickle in my app and the error is gone.

    November 5th, 2010 @ 12:17 PM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.