Skip Menu |

This queue is for tickets about the Encode CPAN distribution.

Report information
The Basics
Id: 100105
Status: resolved
Priority: 0/
Queue: Encode

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

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



Subject: enc2xs -C misunderstands Encode::Detect
On one of my CPAN smokers I'm seeing Encode 2.64 failing. Sample fail report: http://www.cpantesters.org/cpan/report/33eab21a-5ff2-11e4-b0bf-30fcbb36d621 The cause has to do with (1) Encode::Detect is installed This seems a deliberate decision by the logic the smoker uses. (2) an Encode::ConfigLocal file got installed I do not know which process caused this (3) the Encode::ConfigLocal contains a line $Encode::ExtModule{'Detect'} = "Encode::Detect"; (4) taint.t fails as in the above fail report ATM I have no idea about what causes (2), any suggestions welcome. For a solution one would probably like to blacklist Encode::Detect in the enc2xs logic. It's not perfect but probably an improvement.
On Wed Nov 05 23:11:53 2014, ANDK wrote: Show quoted text
> On one of my CPAN smokers I'm seeing Encode 2.64 failing. Sample fail > report: http://www.cpantesters.org/cpan/report/33eab21a-5ff2-11e4- > b0bf-30fcbb36d621 > > The cause has to do with > > (1) Encode::Detect is installed > > This seems a deliberate decision by the logic the smoker uses. > > (2) an Encode::ConfigLocal file got installed > > I do not know which process caused this > > (3) the Encode::ConfigLocal contains a line > $Encode::ExtModule{'Detect'} = "Encode::Detect";
That's natural for Encode::* modules. Encode uses it to make encode('NewEncoding', $str) work. What I don't know is… Show quoted text
> > (4) taint.t fails as in the above fail report >
This. I think it is Encode::Detect that needs fix. Tell the author. Tell him also to add test like taint.t as well. Dan the Maintainer Show quoted text
> ATM I have no idea about what causes (2), any suggestions welcome. For > a solution one would probably like to blacklist Encode::Detect in the > enc2xs logic. It's not perfect but probably an improvement.
On Thu Nov 27 03:10:23 2014, DANKOGAI wrote: Show quoted text
> That's natural for Encode::* modules. Encode uses it to make > encode('NewEncoding', $str) work. What I don't know is…
Encode::Detect is a decode-only charset. Encoding in detect is meaningless.
That's not the point because the same goes to decode('NewEncoding', $str); Please at least perldoc enc2xs before RT-ing. Dan the Maintainer On Mon Dec 01 13:55:12 2014, JGMYERS wrote: Show quoted text
> On Thu Nov 27 03:10:23 2014, DANKOGAI wrote:
> > That's natural for Encode::* modules. Encode uses it to make > > encode('NewEncoding', $str) work. What I don't know is…
> > Encode::Detect is a decode-only charset. Encoding in detect is meaningless.
I don't get your point and don't have the time to puzzle it out. Please provide a proper bug report: reproduction steps, expected results, and actual results.
On 2014-11-05 23:11:53, ANDK wrote: Show quoted text
> On one of my CPAN smokers I'm seeing Encode 2.64 failing. Sample fail > report: http://www.cpantesters.org/cpan/report/33eab21a-5ff2-11e4- > b0bf-30fcbb36d621 > > The cause has to do with > > (1) Encode::Detect is installed > > This seems a deliberate decision by the logic the smoker uses. > > (2) an Encode::ConfigLocal file got installed > > I do not know which process caused this > > (3) the Encode::ConfigLocal contains a line > $Encode::ExtModule{'Detect'} = "Encode::Detect"; > > (4) taint.t fails as in the above fail report > > ATM I have no idea about what causes (2), any suggestions welcome. For > a solution one would probably like to blacklist Encode::Detect in the > enc2xs logic. It's not perfect but probably an improvement.
This can easily be reproduced by the following steps in a CPAN.pm shell: install Encode::Detect install Encode::IBM report Encode Encode::IBM seems to be the only CPAN distribution which runs enc2xs -C as part of make install (judging from grep.cpan.me). Make sure that enc2xs -C works at all (see https://rt.cpan.org/Ticket/Display.html?id=100656 for a sample case where it does not work). Also, +1 for the suggestion to blacklist Encode::Detect in enc2xs.
Encode::Detect isn't the only decode-only charset. Encode::Guess would most likely cause taint.t to fail in the same way if it weren't blacklisted by Encode->encodings(). I note that the taint handling of Encode::Guess->decode() doesn't appear to be tested. A judicious use of can(encode) in taint.t would help. But the Encode harness tests really shouldn't be testing external encodings like this--better for taint.t to ignore the external encodings.
On Mon Dec 01 14:01:07 2014, DANKOGAI wrote: Show quoted text
> That's not the point because the same goes to decode('NewEncoding', > $str); Please at least perldoc enc2xs before RT-ing.
% bin/perl -T -MScalar::Util -MEncode::Detect -e 'my str = "abc" . substr($ENV{PATH},0,0); my $d = Encode::decode ("Detect", $str); print Scalar::Util::tainted($d);' 1 So that is indeed the point.
Encode::Detect users can benefit from the autoloading behavior of enc2xs -C. I don't agree that blacklisting Encode::Detect from enc2xs -C is appropriate.
I have just fixed t/taint.t so that it skips when (en|de)code() croaks. https://github.com/dankogai/p5-encode/commit/6e6588a0ae17f0add5a71418af9a78110e4e9d66 That way you don't have to blacklist Encode::Detect or any module. Case closed. Dan the Encode Maintainer