Skip Menu |

This queue is for tickets about the Parse-CPAN-Meta CPAN distribution.

Report information
The Basics
Id: 67324
Status: resolved
Priority: 0/
Queue: Parse-CPAN-Meta

People
Owner: Nobody in particular
Requestors: ANDK [...] cpan.org
Cc:
AdminCc:

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



Subject: Exception handling weak
In _slurp I see: return do { local $/; <$fh> }; But <$fh> can fail and often fails nowadays due to the :utf8 layer: utf8 "\xF6" does not map to Unicode at /home/src/perl/repoperls/installed-perls/perl/v5.13.11-368-gc2c97af/lib/5.14.0/Parse/CPAN/Meta.pm line 89, <$fh> chunk 1. That should be wrapped in an eval and accompanied with diagnostics that tell the user the file that failed. Same problem when parsing the YAML fails. The diagnostics then is just something like Stream does not end with newline character at bin/parse-all-meta.pl line 65 or CPAN::Meta::YAML does not support a feature in line '!!perl/hash:Module::Build::Version' at bin/parse-all-meta.pl line 65 or CPAN::Meta::YAML failed to classify line '{' at bin/parse-all-meta.pl line 65 On current CPAN YAML::Syck cannot parse 205 META.yaml files, YAML::XS cannot parse 450, but Parse::CPAN::Meta cannot parse 667. The more important is the error handling. WDYT?
Subject: Re: [rt.cpan.org #67324] Exception handling weak
Date: Fri, 8 Apr 2011 08:36:06 -0400
To: bug-Parse-CPAN-Meta [...] rt.cpan.org
From: David Golden <dagolden [...] cpan.org>
On Fri, Apr 8, 2011 at 12:52 AM, Andreas Koenig via RT <bug-Parse-CPAN-Meta@rt.cpan.org> wrote: Show quoted text
> That should be wrapped in an eval and accompanied with diagnostics that > tell the user the file that failed. > > Same problem when parsing the YAML fails. The diagnostics then is just > something like > [snip] > WDYT?
Makes sense to me. Can you point me to an existing META file that files because of utf8 that I can use as a test case? -- David
Sorry I can't, that's the weird thing. I've seen this Unicode message repeatedely, often several times in a row but I could not yet determine where it was triggered. And I have parsed all *.meta files on CPAN and none triggered the Unicode error.
I built an eval around it and it tunrs out it's a warning. Further investigations pending.
On Fri Apr 08 08:36:37 2011, DAGOLDEN wrote: Show quoted text
> Makes sense to me. Can you point me to an existing META file that > files because of utf8 that I can use as a test case? > > -- David
The files for YAML::XS and Test::Portability::Files both have Unicode chars in the author names. I blame the foreigners!