On Mon, 22 Sep 2008 23:54:02 -0400, "Andreas Koenig via RT"
<bug-Text-CSV_XS@rt.cpan.org> wrote:
Show quoted text> Mon Sep 22 23:54:01 2008: Request 39528 was acted upon.
> Transaction: Ticket created by ANDK
> Queue: Text-CSV_XS
> Subject: META.yml references future YAML spec
> Broken in: 0.54
> Severity: Normal
> Owner: Nobody
> Requestors: ANDK@cpan.org
> Status: new
> Ticket <URL:
http://rt.cpan.org/Ticket/Display.html?id=39528 >
>
>
> When parsing the META.yml with YAML.pm I get
>
> perl -wle 'use YAML; YAML::LoadFile
> "/home/ftp/pub/PAUSE/authors/id/H/HM/HMBRAND/Text-CSV_XS-0.54.meta"'
> YAML Warning: Parsing a 1.4 document with a 1.0 parser
> Code: YAML_PARSE_WARN_BAD_MINOR_VERSION
> Line: 2
> Document: 1
> at
> /home/src/perl/repoperls/installed-perls/perl/pdF0gTQ/perl-5.10.0@34384/lib/site_perl/5.11.0/YAML/Base.pm
> line 88
>
> Apparently you wanted to specify a META.yml spec version, not a YAML
> spec version?
You should use Load () instead of LoadFile (). There is a small bug in
YAML.
I've even gone through great effort to check that everything is
correct, but I use YAML::Syck, instead of YAML to check. Besides that,
Load () instead of LoadFile () gives me much more detail about what
could be wrong:
if ($check) {
use YAML::Syck;
use Test::YAML::Meta::Version;
my $h;
eval { $h = Load (join "", @yml) };
$@ and die "$@\n";
$opt_v and print Dump $h;
my $t = Test::YAML::Meta::Version->new (yaml => $h);
$t->parse () and die join "\n", $t->errors, "";
}
META.yml correctly declares 1.4 in both header and trailer, and I know
Text::CSV_XS doesn't really need the 1.4 version, but Spreadsheet::Read
does, and I like all my modules to use the same version when possible.
meta-spec:
version: 1.4
url:
http://module-build.sourceforge.net/META-spec-v1.4.html
Let me show you the difference, and why I upgraded. Here's the test
script I ran to get the output:
--8<---
#!/bin/sh
M=sandbox/META.yml
for d in Text-CSV_XS Spreadsheet-Read ; do
cd ../$d
pwd
for v in 0 4 ; do
echo ""
perl -pi -e'1..1 and s/\d$/'$v'/' $M
head -1 $M
echo using LoadFile YAML::Syck
perl -wl -MYAML::Syck -e "LoadFile ('$M')" && echo === OK
echo using LoadFile YAML
perl -wl -MYAML -e "YAML::LoadFile ('$M')" && echo === OK
echo using Load YAML::Syck
perl -wl -MYAML::Syck -e 'Load (join "", <>)' $M && echo === OK
echo using Load YAML
perl -wl -MYAML -e 'Load (join "", <>)' $M && echo === OK
echo ""
done
echo ""
done
-->8---
And the output
--8<---
$ sh ../chkMETA
/pro/3gl/CPAN/Text-CSV_XS
--- #YAML:1.0
using LoadFile YAML::Syck
=== OK
using LoadFile YAML
=== OK
using Load YAML::Syck
=== OK
using Load YAML
=== OK
--- #YAML:1.4
using LoadFile YAML::Syck
=== OK
using LoadFile YAML
YAML Warning: Parsing a 1.4 document with a 1.0 parser
Code: YAML_PARSE_WARN_BAD_MINOR_VERSION
Line: 2
Document: 1
at /pro/lib/perl5/site_perl/5.10.0/YAML/Base.pm line 88
YAML::Base::warn('YAML::Loader=HASH(0x82e9374)', 'YAML_PARSE_WARN_BAD_MINOR_VERSION', 1.4) called at /pro/lib/perl5/site_perl/5.10.0/YAML/Loader.pm line 95
YAML::Loader::_parse('YAML::Loader=HASH(0x82e9374)') called at /pro/lib/perl5/site_perl/5.10.0/YAML/Loader.pm line 22
YAML::Loader::load('YAML::Loader=HASH(0x82e9374)', '--- #YAML:1.4\x{a}name: Text-CSV_XS\x{a}version: ...') called at /pro/lib/perl5/site_perl/5.10.0/YAML.pm line 33
YAML::Load('--- #YAML:1.4\x{a}name: Text-CSV_XS\x{a}version: ...') called at /pro/lib/perl5/site_perl/5.10.0/YAML.pm line 72
YAML::LoadFile('sandbox/META.yml') called at -e line 1
=== OK
using Load YAML::Syck
=== OK
using Load YAML
YAML Warning: Parsing a 1.4 document with a 1.0 parser
Code: YAML_PARSE_WARN_BAD_MINOR_VERSION
Line: 2
Document: 1
at /pro/lib/perl5/site_perl/5.10.0/YAML/Base.pm line 88
YAML::Base::warn('YAML::Loader=HASH(0x832c80c)', 'YAML_PARSE_WARN_BAD_MINOR_VERSION', 1.4) called at /pro/lib/perl5/site_perl/5.10.0/YAML/Loader.pm line 95
YAML::Loader::_parse('YAML::Loader=HASH(0x832c80c)') called at /pro/lib/perl5/site_perl/5.10.0/YAML/Loader.pm line 22
YAML::Loader::load('YAML::Loader=HASH(0x832c80c)', '--- #YAML:1.4\x{a}name: Text-CSV_XS\x{a}version: ...') called at /pro/lib/perl5/site_perl/5.10.0/YAML.pm line 33
YAML::Load('--- #YAML:1.4\x{a}name: Text-CSV_XS\x{a}version: ...') called at -e line 1
=== OK
/pro/3gl/CPAN/Spreadsheet-Read
--- #YAML:1.0
using LoadFile YAML::Syck
=== OK
using LoadFile YAML
YAML Error: Invalid element in map
Code: YAML_LOAD_ERR_BAD_MAP_ELEMENT
Line: 27
Document: 1
at /pro/lib/perl5/site_perl/5.10.0/YAML.pm line 33
using Load YAML::Syck
=== OK
using Load YAML
YAML Error: Invalid element in map
Code: YAML_LOAD_ERR_BAD_MAP_ELEMENT
Line: 27
Document: 1
at /pro/lib/perl5/site_perl/5.10.0/YAML.pm line 33
--- #YAML:1.4
using LoadFile YAML::Syck
=== OK
using LoadFile YAML
YAML Warning: Parsing a 1.4 document with a 1.0 parser
Code: YAML_PARSE_WARN_BAD_MINOR_VERSION
Line: 2
Document: 1
at /pro/lib/perl5/site_perl/5.10.0/YAML/Base.pm line 88
YAML::Base::warn('YAML::Loader=HASH(0x82e937c)', 'YAML_PARSE_WARN_BAD_MINOR_VERSION', 1.4) called at /pro/lib/perl5/site_perl/5.10.0/YAML/Loader.pm line 95
YAML::Loader::_parse('YAML::Loader=HASH(0x82e937c)') called at /pro/lib/perl5/site_perl/5.10.0/YAML/Loader.pm line 22
YAML::Loader::load('YAML::Loader=HASH(0x82e937c)', '--- #YAML:1.4\x{a}name: Read\x{a}version: ...') called at /pro/lib/perl5/site_perl/5.10.0/YAML.pm line 33
YAML::Load('--- #YAML:1.4\x{a}name: Read\x{a}version: ...') called at /pro/lib/perl5/site_perl/5.10.0/YAML.pm line 72
YAML::LoadFile('sandbox/META.yml') called at -e line 1
YAML Error: Invalid element in map
Code: YAML_LOAD_ERR_BAD_MAP_ELEMENT
Line: 27
Document: 1
at /pro/lib/perl5/site_perl/5.10.0/YAML.pm line 33
using Load YAML::Syck
=== OK
using Load YAML
YAML Warning: Parsing a 1.4 document with a 1.0 parser
Code: YAML_PARSE_WARN_BAD_MINOR_VERSION
Line: 2
Document: 1
at /pro/lib/perl5/site_perl/5.10.0/YAML/Base.pm line 88
YAML::Base::warn('YAML::Loader=HASH(0x832ca44)', 'YAML_PARSE_WARN_BAD_MINOR_VERSION', 1.4) called at /pro/lib/perl5/site_perl/5.10.0/YAML/Loader.pm line 95
YAML::Loader::_parse('YAML::Loader=HASH(0x832ca44)') called at /pro/lib/perl5/site_perl/5.10.0/YAML/Loader.pm line 22
YAML::Loader::load('YAML::Loader=HASH(0x832ca44)', '--- #YAML:1.4\x{a}name: Read\x{a}version: ...') called at /pro/lib/perl5/site_perl/5.10.0/YAML.pm line 33
YAML::Load('--- #YAML:1.4\x{a}name: Read\x{a}version: ...') called at -e line 1
YAML Error: Invalid element in map
Code: YAML_LOAD_ERR_BAD_MAP_ELEMENT
Line: 27
Document: 1
at /pro/lib/perl5/site_perl/5.10.0/YAML.pm line 33
-->8---
--
H.Merijn Brand Amsterdam Perl Mongers
http://amsterdam.pm.org/
using & porting perl 5.6.2, 5.8.x, 5.10.x, 5.11.x on HP-UX 10.20, 11.00,
11.11, 11.23, and 11.31, SuSE 10.1, 10.2, and 10.3, AIX 5.2, and Cygwin.
http://mirrors.develooper.com/hpux/ http://www.test-smoke.org/
http://qa.perl.org http://www.goldmark.org/jeff/stupid-disclaimers/