Syck dies on multiline regex

J

Josh Cheek

[Note: parts of this message were removed to make it a legal post.]

require 'yaml'
[YAML, Marshal].each do |serializer|
[/ab/x, /a
b/x].each do |regex|
begin
serializer.load(serializer.dump regex)
rescue
p $!
end
end
end

# >> #<Syck::TypeError: Invalid Regular expression: "/a\n b/x">



This, in tandem with a few other things, cost me about four hours today (and
made me reconsider my decision to become a nonsmoker -.-).

Is this a bug? If so, where should I report it?
 
R

Ryan Davis

require 'yaml'
[YAML, Marshal].each do |serializer|
[/ab/x, /a
b/x].each do |regex|
begin
serializer.load(serializer.dump regex)
rescue
p $!
end
end
end
=20
# >> #<Syck::TypeError: Invalid Regular expression: "/a\n = b/x">
=20
=20
=20
This, in tandem with a few other things, cost me about four hours = today (and
made me reconsider my decision to become a nonsmoker -.-).
=20
Is this a bug? If so, where should I report it?

It is probably a bug. It _probably_ won't ever get fixed as nobody =
really maintains syck anymore (tho if you come up with a patch, that'd =
certainly help). Try psych if it is possible:

6371 % ruby19 -rpsych -ryaml -e 'p YAML.dump /a
b/x'
"--- !ruby/regexp \"/a\\n b/x\"\n"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,241
Members
46,831
Latest member
RusselWill

Latest Threads

Top