Skip Menu |

This queue is for tickets about the podlators CPAN distribution.

Report information
The Basics
Id: 25240
Status: resolved
Priority: 0/
Queue: podlators

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

Bug Information
Severity: Normal
Broken in:
  • 2.0.2
  • 2.0.3
  • 2.0.4
  • 2.0.5
Fixed in: 2.1.0



Subject: 'Unknown PerlIO layer "encoding"...' message
'make test' generates the following: Testing... /usr/bin/perl.exe "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/basic...........ok t/color...........ok t/filehandle......ok t/man.............Unknown PerlIO layer "encoding" at t/man.t line 41, <DATA> line 2. Unknown PerlIO layer "encoding" at t/man.t line 41, <DATA> line 18. Unknown PerlIO layer "encoding" at t/man.t line 41, <DATA> line 28. Unknown PerlIO layer "encoding" at t/man.t line 41, <DATA> line 51. Unknown PerlIO layer "encoding" at t/man.t line 41, <DATA> line 71. Unknown PerlIO layer "encoding" at t/man.t line 41, <DATA> line 97. Unknown PerlIO layer "encoding" at t/man.t line 41, <DATA> line 125. Unknown PerlIO layer "encoding" at t/man.t line 41, <DATA> line 138. Unknown PerlIO layer "encoding" at t/man.t line 41, <DATA> line 156. Unknown PerlIO layer "encoding" at t/man.t line 41, <DATA> line 166. Unknown PerlIO layer "encoding" at t/man.t line 41, <DATA> line 176. Unknown PerlIO layer "encoding" at t/man.t line 41, <DATA> line 204. Unknown PerlIO layer "encoding" at t/man.t line 41, <DATA> line 216. Unknown PerlIO layer "encoding" at t/man.t line 41, <DATA> line 226. Unknown PerlIO layer "encoding" at t/man.t line 41, <DATA> line 236. Unknown PerlIO layer "encoding" at t/man.t line 41, <DATA> line 258. Unknown PerlIO layer "encoding" at t/man.t line 41, <DATA> line 274. Unknown PerlIO layer "encoding" at t/man.t line 41, <DATA> line 286. Unknown PerlIO layer "encoding" at t/man.t line 41, <DATA> line 324. Unknown PerlIO layer "encoding" at t/man.t line 41, <DATA> line 335. ok t/parselink.......ok t/pod-parser......ok t/termcap.........ok t/text-options....ok t/text............ok All tests successful. Files=9, Tests=75, 3 wallclock secs ( 2.06 cusr + 0.73 csys = 2.79 CPU) This also show up in 'blead'. Can this output be silenced/quieted?
Show quoted text
> Unknown PerlIO layer "encoding" at t/man.t line 41, <DATA> line 18.
Attached is a patch to fix this. This patch has also been submitted to 'blead'.
--- perl-current/lib/Pod/t/man.t 2007-03-01 14:48:15.947134400 -0500 +++ perl-patched/lib/Pod/t/man.t 2007-03-01 14:48:11.310328300 -0500 @@ -38,7 +38,10 @@ # We have a test in ISO 8859-1 encoding. Make sure that nothing strange # happens if Perl thinks the world is Unicode. Wrap this in eval so that # older versions of Perl don't croak. - eval { binmode (\*TMP, ':encoding(iso-8859-1)') }; + eval { + local $SIG{__WARN__} = sub { my @ignore = @_; }; + binmode (\*TMP, ':encoding(iso-8859-1)') + }; while (<DATA>) { last if $_ eq "###\n";
On Thu Mar 01 14:51:58 2007, JDHEDDEN wrote: Show quoted text
> > Unknown PerlIO layer "encoding" at t/man.t line 41, <DATA> line 18.
> > Attached is a patch to fix this. This patch has also been submitted to > 'blead'.
To be clear, I don't know if the offending line: eval { binmode (\*TMP, ':encoding(iso-8859-1)') }; is correct or buggy. (My strong suspicion is that it's buggy, but I have no idea how it would be corrected.) My patch only silences the warnings produced so that 'make test' is 'clean'.
Show quoted text
> In the output from 'make test', I get the following: > > lib/Pod/t/man...............................................Unknown > PerlIO layer "encoding" at ../lib/Pod/t/man.t line 41, <DATA> line 2. > Unknown PerlIO layer "encoding" at ../lib/Pod/t/man.t line 41, <DATA>
The attached patch (really) fixes this. The test script needed to load PerlIO::encoding. This is done using 'require' inside an 'eval' to cover when PerlIO::encoding or Encode are not built. 'binmode' is then conditionally called and so no longer needs to be wrapped in an 'eval'. This patch has also been submitted to 'blead'.
--- perl-current/lib/Pod/t/man.t 2007-03-02 09:56:51.198854500 -0500 +++ perl-patched/lib/Pod/t/man.t 2007-03-02 09:57:32.309198000 -0500 @@ -29,6 +29,8 @@ $loaded = 1; print "ok 1\n"; +my $have_encoding = eval { require PerlIO::encoding; 1; } && ! $@; + my $parser = Pod::Man->new or die "Cannot create parser\n"; my $n = 2; while (<DATA>) { @@ -36,9 +38,8 @@ open (TMP, '> tmp.pod') or die "Cannot create tmp.pod: $!\n"; # We have a test in ISO 8859-1 encoding. Make sure that nothing strange - # happens if Perl thinks the world is Unicode. Wrap this in eval so that - # older versions of Perl don't croak. - eval { binmode (\*TMP, ':encoding(iso-8859-1)') }; + # happens if Perl thinks the world is Unicode. + binmode (\*TMP, ':encoding(iso-8859-1)') if $have_encoding; while (<DATA>) { last if $_ eq "###\n";
This should now be fixed in podlators 2.1.0.