Bogus time format leads to bizarre data

Issue #67 new
Zane Bitter
created an issue

When encountering an unquoted string in a form like "1:00", pyyaml interprets it as a time and returns an int representing the number of seconds (60 in that example).

This is not obviously correct, given that nothing in the YAML specification would lead a user to expect this, but it is what it is.

What is obviously not correct is the behaviour as more colons are added. 1:00:00 returns the number of seconds in an hour as you might expect, but 1:00:00:00 returns the number of seconds in 60 hours, and 1:00:00:00:00 returns the number of seconds in 3600 hours.

Comments (3)

  1. Log in to comment