History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: JRUBY-964
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Ola Bini
Reporter: Albert Strasheim
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
JRuby

YAML ParserException when reading ja.yml from redMine

Created: 20/May/07 03:31 PM   Updated: 22/Dec/07 06:29 AM
Component/s: Core Classes/Modules
Affects Version/s: JRuby 1.0.0RC2
Fix Version/s: JRuby 1.0.0RC3

Time Tracking:
Not Specified

File Attachments: 1. File ja.yml (17 kb)
2. File zh.yml (15 kb)


Testcase included: yes


 Description  « Hide
The YAML parser fails when loading the attached file which comes from redMine. It's Japanese text, so maybe it isn't supported yet?

The code:

require 'yaml'
raw_hash = YAML::load(File.read('ja.yml'))

The error:

ParserImpl.java:496:in `org.jvyamlb.ParserImpl$26.produce': org.jvyamlb.ParserException: ParserException while scanning a block mapping we had this expected <block end>, but found org.jvyamlb.tokens.ScalarToken (NativeException)
from ParserImpl.java:823:in `org.jvyamlb.ParserImpl.parseStreamNext'
from ParserImpl.java:774:in `org.jvyamlb.ParserImpl.peekEvent'
from ComposerImpl.java:161:in `org.jvyamlb.ComposerImpl.composeNode'
from ComposerImpl.java:100:in `org.jvyamlb.ComposerImpl.composeDocument'
from ComposerImpl.java:76:in `org.jvyamlb.ComposerImpl.getNode'
from BaseConstructorImpl.java:97:in `org.jvyamlb.BaseConstructorImpl.getData'
from RubyYAML.java:221:in `org.jruby.RubyYAML.load'
from null:-1:in `org.jruby.RubyYAMLInvokerSload1.call'
... 48 levels...
from Main.java:190:in `org.jruby.Main.runInterpreter'
from Main.java:120:in `org.jruby.Main.run'
from Main.java:95:in `org.jruby.Main.main'
Complete Java stackTrace
while scanning a block mapping
expected <block end>, but found org.jvyamlb.tokens.ScalarToken
org.jvyamlb.ParserException: ParserException while scanning a block mapping we had this expected <block end>, but found org.jvyamlb.tokens.ScalarToken
at org.jvyamlb.ParserImpl$26.produce(ParserImpl.java:496)
at org.jvyamlb.ParserImpl.parseStreamNext(ParserImpl.java:823)
at org.jvyamlb.ParserImpl.peekEvent(ParserImpl.java:774)
at org.jvyamlb.ComposerImpl.composeNode(ComposerImpl.java:161)
at org.jvyamlb.ComposerImpl.composeDocument(ComposerImpl.java:100)
at org.jvyamlb.ComposerImpl.getNode(ComposerImpl.java:76)
at org.jvyamlb.BaseConstructorImpl.getData(BaseConstructorImpl.java:97)
at org.jruby.RubyYAML.load(RubyYAML.java:221)
at org.jruby.RubyYAMLInvokerSload1.call(Unknown Source)
at org.jruby.runtime.callback.FastInvocationCallback.execute(FastInvocationCallback.java:49)
at org.jruby.internal.runtime.methods.SimpleCallbackMethod.call(SimpleCallbackMethod.java:81)
at org.jruby.RubyObject.compilerCallMethod(RubyObject.java:510)
at org.jruby.javasupport.util.CompilerHelpers.doInvokeDynamic(CompilerHelpers.java:123)
at EVAL8970973._file_(EVAL8970973:2)
at EVAL8970973.run(EVAL8970973)
at org.jruby.Ruby.compileOrFallbackAndRun(Ruby.java:306)
at org.jruby.Main.runInterpreter(Main.java:233)
at org.jruby.Main.runInterpreter(Main.java:190)
at org.jruby.Main.run(Main.java:120)
at org.jruby.Main.main(Main.java:95)



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Albert Strasheim - 20/May/07 03:34 PM
Also fails with the attached zh.yml, for what that's worth.

Charles Oliver Nutter - 22/May/07 12:42 PM
No pressure Ola...but you're probably the only one prepared to tackle this sort of thing. If one of us others have a chance, we'll have a look too.

Ola Bini - 24/May/07 07:57 AM
For some reason, the YAML code believed that \u0085 was a space, and when it was encountered as part of characters it was used to split on. Fixed this by not treating 85 special anymore.