Project

General

Profile

Bug #1639

YAML.load fails on some Regexps

Added by vtron (viktor tron) about 10 years ago. Updated about 8 years ago.

Status:
Open
Priority:
Normal
Assignee:
-
ruby -v:
ruby 1.8.7 (2008-08-11 patchlevel 72) [i486-linux]
[ruby-core:23864]

Description

=begin
lib/yaml/rubytypes.rb

Regexp.new('',0,'u')
=> //u
YAML.dump(Regexp.new('',0,'u'))
=> "--- !ruby/regexp //u\n"
YAML.load(YAML.dump(Regexp.new('',0,'u')))
YAML::TypeError: Invalid Regular expression: "//u"
from /usr/lib/ruby/1.8/yaml/rubytypes.rb:275:in yaml_new'
from /usr/lib/ruby/1.8/yaml.rb:133:in
transfer'
from /usr/lib/ruby/1.8/yaml.rb:133:in node_import'
from /usr/lib/ruby/1.8/yaml.rb:133:in
load'
from /usr/lib/ruby/1.8/yaml.rb:133:in `load'
from (irb):30
from :0
=end

Also available in: Atom PDF