Code Monkey home page Code Monkey logo

Comments (4)

HoneyryderChuck avatar HoneyryderChuck commented on June 12, 2024

Hi,

investigated further, and it seems it is all because of these lines:


if t.is_a?(String)
        class << t
          attr_accessor :attributes
        end
        t.attributes = attributes
      end

line 85 - 90 of the xml.rb file.

Apparently, after the insertion of the attributes accessor on the t variable, t is no longer an instance of String, but a singleton instance(?) of String. Not dumpable, therefore. How to fix this? I'll investigate further, just wanted to tell u about so u could know of the issue as well.

from crack.

HoneyryderChuck avatar HoneyryderChuck commented on June 12, 2024

The main culprit of this issue has been (and now a quote from the Marshal class documentation for Ruby 1.x.x):

Some objects cannot be dumped: if the objects to be dumped include bindings, procedure or method objects, instances of class IO, or singleton objects, a TypeError will be raised.

the solutions, as far as i see it is, are:

  • either do it all with instance_variable_get/set methods when it comes to accessing the attributes,
  • or create a subclass that inherits from String, define the attributes accessor inside and move on from there.

what do you think?

from crack.

mhuggins avatar mhuggins commented on June 12, 2024

Anyone have a solution or workaround for this in the past 7 months?

from crack.

kiskoza avatar kiskoza commented on June 12, 2024

Seems to be fixed already

from crack.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.