Skip Menu |

This queue is for tickets about the YAML-Syck CPAN distribution.

Report information
The Basics
Id: 41024
Status: resolved
Priority: 0/
Queue: YAML-Syck

People
Owner: TODDR [...] cpan.org
Requestors: adam_lounds [...] hotmail.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.05
Fixed in: 1.10_01



Subject: Doesn't round-trip strings that look like octal with ImplicitTyping on
for a string "01430730100100000100" with ImplicitTyping enabled and the string unquoted, I get Integer overflow in octal number at xyz/YAML/ Syck.pm line 75, <FH> line 1. Quoting forces it to a string, but on Dump the quotes are removed again. Essentially, Syck isn't quoting on Dump, but expecting quoting on Load when ImplicitTyping is enabled.
From: adam_lounds [...] hotmail.com
script showing warning #!/usr/bin/perl use YAML::Syck; $YAML::Syck::ImplicitTyping = 1; local $SIG{__WARN__} = sub { die(shift); }; my $foo = { a => "01430730100100000100" }; my $dump = YAML::Syck::Dump($foo); eval { my $bar = YAML::Syck::Load($dump); # warning here }; if ($@) { warn("err $@"); } --- Test script showing different values after dump/load cycle #!/usr/bin/perl use YAML::Syck; use Test::More tests => 1; $YAML::Syck::ImplicitTyping = 1; my $foo = { a => "01430730100100000100" }; my $dump = YAML::Syck::Dump($foo); my $bar = YAML::Syck::Load($dump); is ($foo->{a}, $bar->{a}, "round-trip Dump/Load with ImplicitTyping"); --- [adam@adam_dev bin]# perl tst.pl 1..1 Integer overflow in octal number at /xyz/i386-linux-thread-multi/YAML/ Syck.pm line 75. not ok 1 - round-trip Dump/Load with ImplicitTyping # Failed test 'round-trip Dump/Load with ImplicitTyping' # at tst.pl line 10. # got: '01430730100100000100' # expected: '4294967295' # Looks like you failed 1 test of 1.
From: adam_lounds [...] hotmail.com
Ah, I can work around by using $YAML::Syck::SingleQuote = 1 when Dumping
(This is a form-reply that isn't specific to your particular report) YAML::Syck has just acquired one new maintainer (me), it still doesn't have anyone that *cares* about it. But I'm willing to help solve your report & release a new version with the fix if it's easy for me. It now has a Git repository at: http://github.com/avar/YAML-Syck If your report is a patch that fixes a problem, great. Please remake the patch against Git by forking that repo and sending me a pull request on GitHub (or an update to this bug if you prefer git-format-patch(1) or some other repo provider..). Make sure to include a test for what you fixed. If your report is some code that fails (and you have a testcase for it) a patch against the test suite to demonstrate that failure would be very useful. It's OK if the test crashes and burns, see Test::More's docs for how to make TODO tests that fail now, but shouldn't. Even if it segfaults perl C<system $^X => qw/ -Mblib -MYAML::Syck .../> or something like that and checking the return value will do.
octal, hex, and scientific numbers will not be treated as numbers on next release and so will be quoted. I suggest closing this ticket.