You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
irb(main):002:0> s=Psych.safe_load('env:\n DISPLAY: :99')# throws exception about unable to load the `Symbol` classirb(main):002:0> s=Psych.safe_load('env:\n DISPLAY: :99',permitted_classes: [Symbol])=>{"env:\\n DISPLAY"=>:"99"}# Now try quoting the value w/o permitting Symbol:irb(main):003:0> w=Psych.safe_load('env:\n DISPLAY: ":99"')=>{"env:\\n DISPLAY"=>":99"}# contrast the resulting values:irb(main):006:0> s.values[0]=>:"99"irb(main):007:0> w.values[0]=>":99"
Notice that these two values differ... :"99" rather than the expected ":99, ie symbol for "99" vs full string ":99".
Is there a way to configure Psych to treat the colon as part of the string and not a symbol indicator?
The text was updated successfully, but these errors were encountered:
jeffwidman
changed the title
key: :99 reports value as :"99" rather than ":99"key: :99 reports value as :"99" rather than ":99" - how to include second colon as part of the value string?
Dec 2, 2022
Over in dependabot/dependabot-core#5453 a user reported a parsing difficulty with the following example YAML file:
So I tried parsing it:
Notice that these two values differ...
:"99"
rather than the expected":99
, ie symbol for"99"
vs full string":99"
.Is there a way to configure
Psych
to treat the colon as part of the string and not a symbol indicator?The text was updated successfully, but these errors were encountered: