Skip to content

Psych.safe_load internal convert matching scaler Strings that looks like timestamps to class Time which isn't allowed as deserialization class #721

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
torstenfohrer opened this issue Apr 2, 2025 · 0 comments

Comments

@torstenfohrer
Copy link

torstenfohrer commented Apr 2, 2025

At writing a simple example i realize that "dump/serialization" suffers from same problem.

Ruby/Psych: Latest ruby 3.3.x

y.yaml:

---
time: 2025-04-02 13:43:04.841676 +02:00

Ruby Code that tries to load file above

require 'yaml'
a = YAML.load(File.read('/y.yaml'))

Results in a Tried to load unspecified class: Time (Psych::DisallowedClass).

I expect following that psych handles this either by bypassing or allowing it (DisallowdClass). Or handles timestamp like strings AS string.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant