ruby / ruby/psych

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

Open
#153 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
597
Forks
223
Avg merge
11h 23m
Merged PRs (30d)
3

Description

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!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the YAML.load examples for psych and syck, focusing on how ":"-delimited integer strings are interpreted. Trace the Psych YAML.load entry point and existing parser tests to determine the intended unit semantics. Done means resolving or documenting the psych-versus-syck behavior and adding coverage for the reported examples.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.