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
Download (untitled) / with headers
text/plain 713b
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.
Download (untitled) / with headers
text/plain 247b
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.
Download (untitled) / with headers
text/plain 443b
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.
Download (untitled) / with headers
text/plain 160b
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.
Download (untitled) / with headers
text/plain 1.2k
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.
Download (untitled) / with headers
text/plain 454b
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.
Download (untitled) / with headers
text/plain 371b
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.
Download (untitled) / with headers
text/plain 155b
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.
Download (untitled) / with headers
text/plain 268b
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


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.