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

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

Comments

2 participants
@erikj

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

This comment has been minimized.

Show comment Hide comment
@tenderlove

tenderlove Jul 5, 2013

Owner

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). :-(

Owner

tenderlove commented Jul 5, 2013

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