Thanks to visit codestin.com
Credit goes to github.com

Skip to content

YAML.load chokes on Unicode #314

@rkh

Description

@rkh

version: 1.7.0.preview2 (4a6bb0a) in 1.9 mode

require 'yaml'
YAML.load YAML.dump("\u{1f354}")

This even happens in comments:

YAML.load "42 # \u{1f354}"

Both work on MRI. Encoding of the String does not matter.

Exception:

Psych::SyntaxError: special characters are not allowed
    from org/jruby/ext/psych/PsychParser.java:188:in `parse'
    from /Users/konstantin/.rbenv/versions/jruby-1.7.0-preview2/lib/ruby/1.9/psych.rb:203:in `parse_stream'
    from /Users/konstantin/.rbenv/versions/jruby-1.7.0-preview2/lib/ruby/1.9/psych.rb:151:in `parse'
    from /Users/konstantin/.rbenv/versions/jruby-1.7.0-preview2/lib/ruby/1.9/psych.rb:127:in `load'
    from (irb):9:in `evaluate'
    from org/jruby/RubyKernel.java:1070:in `eval'
    from org/jruby/RubyKernel.java:1395:in `loop'
    from org/jruby/RubyKernel.java:1178:in `catch'
    from org/jruby/RubyKernel.java:1178:in `catch'
    from /Users/konstantin/.rbenv/versions/jruby-1.7.0-preview2/bin/irb:13:in `(root)'

I know your bussy, but please get in touch about potential solutions for this, as Travis CI is suffering from it in production (unfortunately rolling back to 1.6 is not an option atm).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions