Skip to content
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

psych parses ":"-delimited time strings differently than syck #153

Open
erikj opened this issue Jul 2, 2013 · 1 comment
Open

psych parses ":"-delimited time strings differently than syck #153

erikj opened this issue Jul 2, 2013 · 1 comment

Comments

@erikj
Copy link

erikj commented Jul 2, 2013

I'm not sure if this is a bug or changed behavior, perhaps I could get some clarification or resolution via this issue:

colon-delimited strings of integers are parsed by YAML into integer number of seconds. it appears that the psych engine treats the last unit as minutes, whereas syck treated it as seconds, ie.:

#1.9.3
ruby-1.9.3-p392>> require 'yaml'
=> true
ruby-1.9.3-p392>> YAML.load '1:00'
=> 3600
ruby-1.9.3-p392>> YAML::ENGINE.yamler = 'syck'
=> "syck"
ruby-1.9.3-p392>> YAML.load '1:00'
=> 60

#2.0.0
ruby-2.0.0-p195>> require 'yaml'
=> true
ruby-2.0.0-p195>> YAML.load '1:00'
=> 3600

if this change of behavior is documented somewhere, I'd appreciate if you could point me to it.

thanks!

@tenderlove
Copy link
Member

Hrm. I'm not sure what to do about this. I believe this is a bug in the base 60 support. I don't think the behavior should have changed. I must dig further.

One thing that's interesting, it looks like YAML 1.1 supports base 60 floats but YAML 1.2 does not. I'm not sure how that will impact us (eventually). :-(

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

2 participants