Bug #7568

Yaml fails to encode zero date string.

Added by Anshul Khandelwal over 1 year ago. Updated over 1 year ago.

[ruby-core:50913]
Status:Assigned
Priority:Normal
Assignee:Aaron Patterson
Category:-
Target version:-
ruby -v:ruby 1.9.3p327 (2012-11-10 revision 37606) [x86_64-linux] Backport:

Description

"0000-00-00 00:00:00".to_yaml fails with an ArgumentError.

Reproducing steps

In irb type,

require 'yaml'
"0000-00-00 00:00:00".to_yaml

What was expected

=> "--- '0000-00-00 00:00:00'\n"

What happened

ArgumentError: argument out of range
from /usr/local/rbenv/versions/1.9.3-p327/lib/ruby/1.9.1/psych/scalar_scanner.rb:111:in `utc'

History

#1 Updated by Charlie Somerville over 1 year ago

  • Status changed from Open to Assigned
  • Assignee set to Aaron Patterson

=begin
This was fixed in r37288.

It might be worth backporting the fix to 1.9.3. Thoughts tenderlove?
=end

#2 Updated by Anonymous over 1 year ago

On Sun, Dec 16, 2012 at 12:53:14PM +0900, charliesome (Charlie Somerville) wrote:

Issue #7568 has been updated by charliesome (Charlie Somerville).

Status changed from Open to Assigned
Assignee set to tenderlovemaking (Aaron Patterson)

=begin
This was fixed in r37288.

It might be worth backporting the fix to 1.9.3. Thoughts tenderlove?

Ya, I can submit a backport ticket. I need to figure out which commits
should go in to a bugfix release of psych. The alternative is just to
release a new version of the gem, and we don't need to backport
anything.

--
Aaron Patterson
http://tenderlovemaking.com/

#3 Updated by Luis Lavena over 1 year ago

On Wed, Dec 19, 2012 at 3:06 PM, Aaron Patterson
tenderlove@ruby-lang.org wrote:

Ya, I can submit a backport ticket. I need to figure out which commits
should go in to a bugfix release of psych. The alternative is just to
release a new version of the gem, and we don't need to backport
anything.

The problem with that approach is on a new patchlevel release the user
will get "downgraded" to a previous version of the gem, where the
problem exists.

--
Luis Lavena
AREA 17
-
Perfection in design is achieved not when there is nothing more to add,
but rather when there is nothing more to take away.
Antoine de Saint-Exupéry

#4 Updated by Anonymous over 1 year ago

On Thu, Dec 20, 2012 at 11:40:10PM +0900, Luis Lavena wrote:

On Wed, Dec 19, 2012 at 3:06 PM, Aaron Patterson
tenderlove@ruby-lang.org wrote:

Ya, I can submit a backport ticket. I need to figure out which commits
should go in to a bugfix release of psych. The alternative is just to
release a new version of the gem, and we don't need to backport
anything.

The problem with that approach is on a new patchlevel release the user
will get "downgraded" to a previous version of the gem, where the
problem exists.

Good point. I'll figure out the appropriate backport requests. :-)

--
Aaron Patterson
http://tenderlovemaking.com/

Also available in: Atom PDF