http://www.perlmonks.org?node_id=1136814


in reply to Solved: Re: Test::Exception error on Strawberry Perl 5.14.3 ('Bareword "xception" ...') [ Bug in Perl ]
in thread Test::Exception error on Strawberry Perl 5.14.3 ('Bareword "xception" ...')

This is funny first two loop forever high CPU (trace says at binmode STDERR), the last one doesn't
perl -d:Trace -e " eval q{ use open qw/ :std :encoding(utf8) /; use T +est::Exception; }; warn $@ " 2>2 perl -MCarp::Always -e " use open qw/ :std :encoding(UTF-8) /; use Te +st::Exception; " perl -e " use open qw/ :std :encoding(UTF-8) /; use Test::Exception; +"
happens on both v5.12.2 and v5.14.1, 5.14.1 has
Encode 2.47 Encode::Alias 2.16 Encode::Config 2.05 Encode::Encoding 2.05 Exporter 5.66 Exporter::Heavy 5.66 PerlIO 1.07 PerlIO::encoding 0.14 Sub::Uplevel 0.24 Test::Builder 0.98 Test::Exception 0.31 XSLoader 0.15 base 2.18 bytes 1.04 constant 1.21 open 1.08 vars 1.02 warnings 1.12 warnings::register 1.02

5.12.2 has

Encode 2.43 Encode::Alias 2.14 Encode::Config 2.05 Encode::Encoding 2.05 Exporter 5.64_01 Exporter::Heavy 5.64_01 PerlIO 1.06 PerlIO::encoding 0.12 Sub::Uplevel 0.22 Test::Builder 0.98 Test::Exception 0.31 XSLoader 0.15 base 2.15 bytes 1.04 open 1.07 vars 1.01 warnings 1.09 warnings::register 1.01

Definitely an perl/perlio/open/Encode bug ... here is why I think that

$ set PERL_ENCODE_DEBUG=999 $ perl -e " use Devel::Modlist; use open qw/ :std :encoding(utf8) /; u +se Test::Exception; " Encode::utf8 XS on at C:/perl/5.14.1/lib/MSWin32-x86-multi-thread/Enco +de.pm line 298. Bareword "xception" not allowed while "strict subs" in use at C:/perl/ +site/5.14.1/lib/Test/Exception.pm line 4. Compilation failed in require at -e line 1. BEGIN failed--compilation aborted at -e line 1. $ perl -e " use Devel::Modlist; use open qw/ :std :encoding(UTF-8) /; +use Test::Exception; " Encode::utf8 XS on at C:/perl/5.14.1/lib/MSWin32-x86-multi-thread/Enco +de.pm line 298. eval "utf-8-strict" at C:/perl/5.14.1/lib/MSWin32-x86-multi-thread/Enc +ode/Alias.pm line 32. (?^i:\bUTF-8$), utf-8-strict at C:/perl/5.14.1/lib/MSWin32-x86-multi-t +hread/Encode/Alias.pm line 45. find_alias(Encode, UTF-8)->name = utf-8-strict at C:/perl/5.14.1/lib/M +SWin32-x86-multi-thread/Encode/Alias.pm line 75. find_alias(Encode, UTF-8)->name = utf-8-strict at C:/perl/5.14.1/lib/M +SWin32-x86-multi-thread/Encode/Alias.pm line 75. $ perl -e " use Devel::Modlist; use Test::Exception; use open qw/ :st +d :encoding(UTF-8) /; " Encode::utf8 XS on at C:/perl/5.14.1/lib/MSWin32-x86-multi-thread/Enco +de.pm line 298. eval "utf-8-strict" at C:/perl/5.14.1/lib/MSWin32-x86-multi-thread/Enc +ode/Alias.pm line 32. (?^i:\bUTF-8$), utf-8-strict at C:/perl/5.14.1/lib/MSWin32-x86-multi-t +hread/Encode/Alias.pm line 45. find_alias(Encode, UTF-8)->name = utf-8-strict at C:/perl/5.14.1/lib/M +SWin32-x86-multi-thread/Encode/Alias.pm line 75. find_alias(Encode, UTF-8)->name = utf-8-strict at C:/perl/5.14.1/lib/M +SWin32-x86-multi-thread/Encode/Alias.pm line 75. $ perl -e " use Devel::Modlist; use Test::Exception; use open qw/ :st +d :encoding(utf8) /; " Encode::utf8 XS on at C:/perl/5.14.1/lib/MSWin32-x86-multi-thread/Enco +de.pm line 298. Config Encode 2.47 Encode::Alias 2.16 Encode::Config 2.05 Encode::Encoding 2.05 Exporter 5.66 Exporter::Heavy 5.66 PerlIO 1.07 PerlIO::encoding 0.14 Sub::Uplevel 0.24 Test::Builder 0.98 Test::Exception 0.31 XSLoader 0.15 base 2.18 bytes 1.04 constant 1.21 open 1.08 vars 1.02 warnings 1.12 warnings::register 1.02

Basically a serious bug is in there in XS land somewhere, will see what happens after upgrades

  • Comment on Re: Solved: Re: Test::Exception error on Strawberry Perl 5.14.3 ('Bareword "xception" ...') [ Bug in Perl ]
  • Select or Download Code

Replies are listed 'Best First'.
Re^2: Solved: Re: Test::Exception error on Strawberry Perl 5.14.3 ('Bareword "xception" ...') [ Bug in Perl ]
by Anonymous Monk on Jul 30, 2015 at 00:53 UTC

      Thank you for digging into this. I also learned that 5.14.3 is not officially supported, so I am inclined not to worry about the bug and the test failure.

      I would like to have zero test failures, however, so I am thinking I will change the use open() call to a use if ... statement so it doesn't load under the broken perl/OS combo.

      The way forward always starts with a minimal test.

        I would like to have zero test failures, however, so I am thinking I will change the use open() call to a use if ... statement so it doesn't load under the broken perl/OS combo.

        Naturally you're free to do what you think is best

        but

        why do you even care that STDIN/STDERR/STDOUT are in utf8?

        most windows machines don't show unicode by default unless you do chcp

        test suite shouldn't much care if STD* are utf8, if there is an encoding problem in a failing test, byte information is what is important , not correct drawing/rendering in the local shell

        but if you care just binmode $_, q{:utf8} for *STDIN, *STDOUT, *STDERR;