Project

General

Profile

Bug #9873

YAML conversion of empty symbol

Added by sawa (Tsuyoshi Sawada) about 5 years ago. Updated about 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
ruby 2.1.2
[ruby-core:62825]

Description

The yaml gem changes the empty symbol into a string of a colon:

require "yaml"
:"".to_yaml # => "--- ! ':'\n"

So, the following round trip fails to maintain the original:

YAML.load(:"".to_yaml) # => ":"

Associated revisions

Revision 3f6eafaa
Added by tenderlove about 5 years ago

  • ext/psych/lib/psych/visitors/yaml_tree.rb: dump empty symbols with a tag so that they can be parsed on input. [Bug #9873] [ruby-core:62825]
  • test/psych/test_symbol.rb: test for change

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46358 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 46358
Added by tenderlove about 5 years ago

  • ext/psych/lib/psych/visitors/yaml_tree.rb: dump empty symbols with a tag so that they can be parsed on input. [Bug #9873] [ruby-core:62825]
  • test/psych/test_symbol.rb: test for change

Revision 46358
Added by tenderlovemaking (Aaron Patterson) about 5 years ago

  • ext/psych/lib/psych/visitors/yaml_tree.rb: dump empty symbols with a tag so that they can be parsed on input. [Bug #9873] [ruby-core:62825]
  • test/psych/test_symbol.rb: test for change

Revision 46358
Added by tenderlove about 5 years ago

  • ext/psych/lib/psych/visitors/yaml_tree.rb: dump empty symbols with a tag so that they can be parsed on input. [Bug #9873] [ruby-core:62825]
  • test/psych/test_symbol.rb: test for change

Revision 46358
Added by tenderlove about 5 years ago

  • ext/psych/lib/psych/visitors/yaml_tree.rb: dump empty symbols with a tag so that they can be parsed on input. [Bug #9873] [ruby-core:62825]
  • test/psych/test_symbol.rb: test for change

Revision 46358
Added by tenderlove about 5 years ago

  • ext/psych/lib/psych/visitors/yaml_tree.rb: dump empty symbols with a tag so that they can be parsed on input. [Bug #9873] [ruby-core:62825]
  • test/psych/test_symbol.rb: test for change

Revision 46358
Added by tenderlove about 5 years ago

  • ext/psych/lib/psych/visitors/yaml_tree.rb: dump empty symbols with a tag so that they can be parsed on input. [Bug #9873] [ruby-core:62825]
  • test/psych/test_symbol.rb: test for change

History

#1

Updated by Anonymous about 5 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

Applied in changeset r46358.


  • ext/psych/lib/psych/visitors/yaml_tree.rb: dump empty symbols with a tag so that they can be parsed on input. [Bug #9873] [ruby-core:62825]
  • test/psych/test_symbol.rb: test for change

Also available in: Atom PDF