Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Yaml containing escaped single quote fails to parse, works under MRI #2199

Closed
camertron opened this issue Nov 14, 2014 · 6 comments
Closed

Comments

@camertron
Copy link

Running JRuby in ruby 2.0 mode:

$> require 'yaml'
$> YAML.load('"foo\\\'bar"')
Psych::SyntaxError: (<unknown>): found unknown escape character '(39) while scanning a double-quoted scalar at line 1 column 6

Running MRI 2.0:

$> require 'yaml'
$> YAML.load('"foo\\\'bar"')
=> "foo'bar"
camertron added a commit to rosette-proj/rosette-extractor-yaml that referenced this issue Nov 15, 2014
Addresses a discrepancy between MRI/psych and jruby/snakeyaml parsing,
see: jruby/jruby#2199
@headius
Copy link
Member

headius commented Nov 17, 2016

Guess it's not a YAML 1.1 thing, since Ruby 2.3.2 handles it fine.

@headius
Copy link
Member

headius commented Nov 17, 2016

@camertron
Copy link
Author

Thanks @headius!

@asomov
Copy link

asomov commented Nov 18, 2016

According to the YAML 1.1 spec the ' is not a valid escape sequence
http://yaml.org/spec/1.1/#id872840
I did not quite catch how it works in MRI.

@asomov
Copy link

asomov commented Nov 19, 2016

What is the bug tracker for MRI 2.0 to report a bug while parsing YAML ?

@headius
Copy link
Member

headius commented Nov 10, 2017

Closing in favor of #4847.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants