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
MIME-Version: 1.0
X-Mailer: MIME-tools 5.426 (Entity 5.426)
Content-Type: text/plain
Charset: utf8
Content-Disposition: inline
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 352
Download (untitled) / with headers
text/plain 352b
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.
MIME-Version: 1.0
X-Mailer: MIME-tools 5.426 (Entity 5.426)
Content-Disposition: inline
Charset: utf8
Message-Id: <rt-3.6.HEAD-5597-1227012532-1520.41024-0-0 [...] rt.cpan.org>
Content-Type: text/plain
Content-Transfer-Encoding: binary
From: adam_lounds [...] hotmail.com
X-RT-Original-Encoding: utf-8
Content-Length: 1022
Download (untitled) / with headers
text/plain 1022b
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.
MIME-Version: 1.0
X-Mailer: MIME-tools 5.426 (Entity 5.426)
Content-Disposition: inline
Charset: utf8
Message-Id: <rt-3.6.HEAD-5560-1227012623-1827.41024-0-0 [...] rt.cpan.org>
Content-Type: text/plain
Content-Transfer-Encoding: binary
From: adam_lounds [...] hotmail.com
X-RT-Original-Encoding: utf-8
Content-Length: 73
Ah, I can work around by using $YAML::Syck::SingleQuote = 1 when Dumping
MIME-Version: 1.0
In-Reply-To: <rt-3.6.HEAD-5560-1227012623-1827.41024-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
References: <rt-3.6.HEAD-5560-1227012623-1827.41024-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="UTF-8"
Message-ID: <rt-3.8.HEAD-6788-1274354472-262.41024-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 1046
(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.
MIME-Version: 1.0
In-Reply-To: <rt-3.6.HEAD-5560-1227012623-1827.41024-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
References: <rt-3.6.HEAD-5560-1227012623-1827.41024-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="UTF-8"
Message-ID: <rt-3.8.HEAD-2367-1279250666-116.41024-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 136
Download (untitled) / with headers
text/plain 136b
octal, hex, and scientific numbers will not be treated as numbers on next release and so will be quoted. I suggest closing this ticket.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.