Project

General

Profile

Actions

Bug #9873

closed

YAML conversion of empty symbol

Added by sawa (Tsuyoshi Sawada) almost 10 years ago. Updated almost 10 years ago.

Status:
Closed
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) # => ":"
Actions #1

Updated by Anonymous almost 10 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
Actions

Also available in: Atom PDF

Like0
Like0