Skip Menu |
 

This queue is for tickets about the Filter CPAN distribution.

Report information
The Basics
Id: 41285
Status: resolved
Priority: 0/
Queue: Filter

People
Owner: RURBAN [...] cpan.org
Requestors: SREZIC [...] cpan.org
Cc:
AdminCc:

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



Subject: Tests may fail if non-english locale is used
Download (untitled) / with headers
text/plain 199b
With my default locale settings (de_DE.ISO8859-1) the exec and sh tests fail. If I set the locale to "C", then everything passes. Feel free to ask if you need more diagnostics. Regards, Slaven
Download (untitled) / with headers
text/plain 621b
On 2008-11-28 02:55:16, SREZIC wrote: Show quoted text
> With my default locale settings (de_DE.ISO8859-1) the exec and sh tests > fail. If I set the locale to "C", then everything passes. > > Feel free to ask if you need more diagnostics. >
This is still failing. In the case of the "sh" test, it's a non-portable usage of tr. If a German locale is active, then the output is as follows: $ echo t | tr '[a-z]' '[A-Z]' U With a "C" locale the output is as expected: $ echo t | env LANG=C LC_ALL=C tr '[a-z]' '[A-Z]' T To be portable, a character class should be used: $ echo t | tr '[:lower:]' '[:upper:]' T Regards, Slaven
Download (untitled) / with headers
text/plain 474b
On Thu Jan 24 15:43:09 2013, SREZIC wrote: Show quoted text
> On 2008-11-28 02:55:16, SREZIC wrote:
> > With my default locale settings (de_DE.ISO8859-1) the exec and sh tests > > fail. If I set the locale to "C", then everything passes. > > Feel free to ask if you need more diagnostics. > >
> > This is still failing.
Hi Slaven, I don't have any non-english systems anymore around. Can you try my attempt if I fixed it? https://github.com/rurban/Filter/commits/ Thanks -- Reini Urban
Please test 1.46 -- Reini Urban
Download (untitled) / with headers
text/plain 848b
On 2013-03-29 12:58:21, RURBAN wrote: Show quoted text
> Please test 1.46
1.48 still fails on my system, but see https://github.com/rurban/Filter/pull/1 Adding some explanations for this pull request: - On my system is only LC_ALL set. But the test scripts used only to check for the LANG env var, so the code setting the env vars to C was never triggered. - But checking LC_ALL and LANG is not enough, actually LC_CTYPE needs to be checked. - Instead of checking all possible env vars, it's probably better to use POSIX::setlocale (like I am proposing in the pull request) - The code setting the env vars should also set LC_CTYPE=C - And the BEGIN{...} block was missing here. With the changes the tests pass on my FreeBSD system with a German and a C locale. Things still work on a Debian/wheezy system, both with a German and a C locale. Regards, Slaven
Thanks for the fix. Published as 1.49 -- Reini Urban


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.