Comments (4)
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.
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.
Anyone have a solution or workaround for this in the past 7 months?
from crack.
Seems to be fixed already
from crack.
Related Issues (20)
- YAML load errors when parsing JSON that initially contained a \u0000 character sequence HOT 2
- Psych::SyntaxError while parsing JSON using rails 3.0.2/ruby 1.9.2p180 HOT 9
- Crack treats JSON parsing errors differently depending on the underlying YAML parser HOT 1
- Xml not parsing properly HOT 1
- Add bigdecimal to gemspec HOT 1
- many json tests are failing with ruby 1.9 HOT 2
- Fails to run Jekyll 1.0.3 (conflicting versions of safe_yaml) on Mac OSX 10.8.3 HOT 1
- Support for Attributes HOT 2
- Crack::JSON is not parsing UTF-8 correctly HOT 1
- Crack::JSON can't parse valid json string with UTF-8 character
- Issue with array of elements when the key is an attribute of the nodw HOT 2
- Key mangling when using two dates HOT 1
- Crack 0.4.3 cannot parse two consecutive dates HOT 1
- Xml parsing dont return attribute of tag HOT 1
- make a 1.0.0 release? HOT 5
- Remove `test/` from bundled gem HOT 4
- Please include license file in the gem. HOT 1
- Missing v0.4.5 tag HOT 2
- JSON failures with Ruby 3.1 / Psych 4.0
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from crack.