Skip to content

Can't load time with year greater than or equal to 10000 #393

Description

@jcbpl

Steps to reproduce

require"psych"require"time"require"minitest/autorun"classYearTenThousandTest < Minitest::Testdeftest_year_ten_thousandtime=Time.parse("10000-01-01 00:00:00")yaml_string=Psych.dump(time)yaml_time=Psych.load(yaml_string)assert_equalyaml_time,timeendend

Expected behavior

Expected Psych.load to return a Time object, like it does for years <= 9999.

Actual behavior

It returns a string.

System configuration

Ruby version: 2.6.1

Originally reported as rails/rails#35783

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions