Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the YAML CPAN distribution.

Report information
The Basics
Id: 97870
Status: resolved
Priority: 0/
Queue: YAML

People
Owner: Nobody in particular
Requestors: mprokop [...] sipwise.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: YAML::Tiny >=1.60 generates certain(?) strings without quotes
Date: Fri, 8 Aug 2014 10:18:02 +0200
To: bug-YAML-Tiny [...] rt.cpan.org
From: Michael Prokop <mprokop [...] sipwise.com>
Hi! I noticed a parsing problem with a YAML file which is caused by the way YAML::Tiny generates the YAML file since recent versions. Minimized demo code: % cat demo.pl #!/usr/bin/perl use strict; use warnings; use YAML::Tiny; my $yaml = YAML::Tiny->new; my $outputfile = shift; $yaml->[0]->{foo} = '^00|\+([1-9][0-9]+)$'; open(my $fh, '>', "$outputfile"); print $fh $yaml->write_string(); Now that's what's working as expected with older versions: % dpkg --list libyaml-tiny-perl | grep '^ii' ii libyaml-tiny-perl 1.56-1 all Perl module for reading and writing YAML files % perl ./demo.pl demo.yml % cat demo.yml --- foo: '^00|\+([1-9][0-9]+)$' But at least since YAML::Tiny v1.60 (verified with 1.60 + 1.63) it's generating unexpected output WRT the quoting: % dpkg --list libyaml-tiny-perl | grep '^ii' ii libyaml-tiny-perl 1.63-1 all Perl module for reading and writing YAML files % perl ./demo.pl demo.yml % cat demo.yml --- foo: ^00|\+([1-9][0-9]+)$ Notice the missing quotes around the '^00...' string in its output. Is this expected behaviour? If so, is there any way how to still get the quotes so the file can be further processed without breaking? System environment: Perl v5.18.2 on Debian/jessie (amd64) Thanks! regards, -mika-
Download signature.asc
application/pgp-signature 197b

Message body not shown because it is not plain text.

Subject: Re: [rt.cpan.org #97870] YAML::Tiny >=1.60 generates certain(?) strings without quotes
Date: Fri, 8 Aug 2014 11:09:47 -0700
To: Michael Prokop via RT <bug-YAML-Tiny [...] rt.cpan.org>
From: Karen Etheridge <ether [...] cpan.org>
On Fri, Aug 08, 2014 at 04:18:20AM -0400, Michael Prokop via RT wrote: Show quoted text
> I noticed a parsing problem with a YAML file which is caused by the way > YAML::Tiny generates the YAML file since recent versions.
Show quoted text
> Notice the missing quotes around the '^00...' string in its output. > > Is this expected behaviour?
In general, YAML only adds quotes around strings when necessary, and leaves them off otherwise. Show quoted text
> If so, is there any way how to still get > the quotes so the file can be further processed without breaking?
Can you clarify what "breaking" means? What are you using to read the YAML file that is breaking, and what is its version? Can you perhaps include some code that generates the error you are seeing?
Subject: Re: [rt.cpan.org #97870] YAML::Tiny >=1.60 generates certain(?) strings without quotes
Date: Tue, 12 Aug 2014 12:21:46 +0200
To: Karen Etheridge via RT <bug-YAML-Tiny [...] rt.cpan.org>
From: Michael Prokop <mprokop [...] sipwise.com>
Hi! * Karen Etheridge via RT [Fri Aug 08, 2014 at 02:09:58PM -0400]: Show quoted text
> On Fri, Aug 08, 2014 at 04:18:20AM -0400, Michael Prokop via RT wrote:
Show quoted text
> > I noticed a parsing problem with a YAML file which is caused by the way > > YAML::Tiny generates the YAML file since recent versions.
[...] Show quoted text
> > If so, is there any way how to still get > > the quotes so the file can be further processed without breaking?
Show quoted text
> Can you clarify what "breaking" means? What are you using to read the YAML > file that is breaking, and what is its version?
Show quoted text
> Can you perhaps include some code that generates the error you are seeing?
Sure, this is the minimized version of the code that's in use and broke with the change: % cat foo.pl #!/usr/bin/perl use strict; use warnings; use Hash::Merge qw(merge); use YAML qw/LoadFile/; my $file = "demo.yml"; my $config = {}; $config = merge($config, LoadFile($file) || die $!); Now using the input as noted in my initial mail: % cat demo.yml --- foo: ^00|\+([1-9][0-9]+)$ ... this fails with: % perl ./foo.pl YAML Error: Unrecognized implicit value '^00|\+([1-9][0-9]+)$' Code: YAML_PARSE_ERR_BAD_IMPLICIT Line: 2 Document: 1 at /usr/share/perl5/YAML/Loader.pm line 567. It works fine with the strings around the ^00.... as generated from previous versions of YAML::Tiny. FTR: /usr/share/perl5/YAML/Loader.pm is from libyaml-perl, version 0.98. Thanks! regards, -mika-
Download signature.asc
application/pgp-signature 197b

Message body not shown because it is not plain text.

Subject: Re: [rt.cpan.org #97870] YAML::Tiny >=1.60 generates certain(?) strings without quotes
Date: Thu, 18 Sep 2014 21:34:48 +0200
To: Karen Etheridge via RT <bug-YAML-Tiny [...] rt.cpan.org>
From: Michael Prokop <mprokop [...] sipwise.com>
Hi, following up my mail from Tue Aug 12 06:22:06 2014, do you need anything further from my side or is there anything specific where I might help? It would be great if this issue could be resolved in time for the upcoming Debian/stable release (AKA jessie). :) Thanks! regards, -mika-
Download signature.asc
application/pgp-signature 197b

Message body not shown because it is not plain text.

This is not a bug in YAML::Tiny. YAML::Tiny is dumping correctly. It's a bug in YAML.pm's loader (which is often the case). All the other YAML modules load this correctly. Ingy just fixed this in YAML.pm and released YAML-1.12.tar.gz.
Subject: Re: [rt.cpan.org #97870] YAML::Tiny >=1.60 generates certain(?) strings without quotes
Date: Mon, 22 Sep 2014 22:29:23 +0200
To: Karen Etheridge via RT <bug-YAML-Tiny [...] rt.cpan.org>
From: Michael Prokop <mprokop [...] sipwise.com>
* Karen Etheridge via RT [Mon Sep 22, 2014 at 12:13:50PM -0400]: Show quoted text
Show quoted text
> This is not a bug in YAML::Tiny. YAML::Tiny is dumping correctly. It's a bug in > YAML.pm's loader (which is often the case). All the other YAML modules load > this correctly.
Show quoted text
> Ingy just fixed this in YAML.pm and released YAML-1.12.tar.gz.
Awesome news, thanks for taking care! regards, -mika-
Download signature.asc
application/pgp-signature 197b

Message body not shown because it is not plain text.