Ruby implementation of the ICU (International Components for Unicode) that uses the Common Locale Data Repository to format dates, plurals, and more.
672
stars
93
forks
source link
Ruby 3.1.0 with Psych 4 forces YAML.safe_load and throws Psych::DisallowedClass #247
Closed
doits closed 2 years ago
Describe the bug
Just a heads up for Ruby 3.1: It ships with Psych 4 by default and uses
YAML.safe_load
even withYAML.load
, see https://bugs.ruby-lang.org/issues/17866 and https://github.com/ruby/psych/blob/75ab76e7888df143012afb1cb6b89ccca28a4451/lib/psych.rb#L369-L377.You get this error for example:
To Reproduce Steps to reproduce the behavior:
['ALB'].localize('en').sort
Environment Ruby 3.1.0 with Psych 4.0.3
Possible solutions
YAML.safe_load
and manually allow whatever classes are needed (so it works on new and old rubies)