Closed p5pRT closed 12 years ago
Hello Porters\,
http://perlmonks.org/?node=973257 contains a bugreport and bugfix by mrthom for testing Perl on Czech locales.
The (tested?) fix invokes `tail +2`. Is that sane to assume for the tests?
The alternative would be to munge the results in Perl\, removing the top line unconditionally in the hope that the output of `ls -`l` always contains the locale-equivalent of
total 666
as its first line. I've attached the patch below [1] (instead of applying it)\, as I'm not sure whether Perl shouldn't try instead to clean out all locale settings and run its tests under locale "C" to avoid such issues. The alternative would be to force the C locale\, as hinted at in http://perlmonks.org/?node=973418 and also used in t/op/exec.t and t/op/groups.t [2]
$ENV{LC_ALL} = 'C';
I can't test either\, as I cannot replicate the environment.
If this patch goes in\, I also nominate it for backporting into 5.16.1 \, or at least a note to be made in the "Known Issues" about the locale.
-max
[1] 0001-Don-t-test-first-line-of-ls-l-output.patch [2] 0001-Force-external-tools-to-speak-English.patch
On Sun\, Jun 03\, 2012 at 03:30:16AM -0700\, Max Maischein wrote:
The (tested?) fix invokes `tail +2`. Is that sane to assume for the tests?
It seems so\, in that it worked on both the AIX and HP-UX machines I have access to\, so it doesn't seem to be a recent non-standard flag.
as its first line. I've attached the patch below [1] (instead of applying it)\, as I'm not sure whether Perl shouldn't try instead to clean out all locale settings and run its tests under locale "C" to avoid such issues. The alternative would be to force the C locale\, as hinted at in http://perlmonks.org/?node=973418 and also used in t/op/exec.t and t/op/groups.t [2]
$ENV\{LC\_ALL\} = 'C';
I can't test either\, as I cannot replicate the environment.
I think it would be better to clean out the environment. It seems less fragile\, and it's how we're already dealing with this sort of problem.
Frustratingly\, it seems that I can't test this *either*\, as both the systems that I have access to that have a Czech locale available show the first line as "Total". (One being current Ubuntu - I'm surprised that they aren't up to date)
Personally\, I wouldn't put it in the BEGIN block\, although I see that t/op/groups.t does. (t/op/exec.t doesn't). I guess I have this gut feeling that BEGIN blocks are special\, and should only contain things that really need to be done at begin time.
diff --git a/t/op/stat.t b/t/op/stat.t index af1fa5e..3b7a906 100644 --- a/t/op/stat.t +++ b/t/op/stat.t @@ -1\,6 +1\,8 @@ #!./perl
BEGIN { + $ENV{LC_ALL} = "C"; # so that external utilities speak English + $ENV{LANGUAGE} = 'C'; # GNU locale extension chdir 't' if -d 't'; @INC = '../lib'; require './test.pl'; # for which_perl() etc -- 1.6.5.1.1367.gcd48
Nicholas Clark
The RT System itself - Status changed from 'new' to 'open'
On Sun\, 3 Jun 2012 20:49:33 +0100\, Nicholas Clark \nick@​ccl4\.org wrote:
On Sun\, Jun 03\, 2012 at 03:30:16AM -0700\, Max Maischein wrote:
The (tested?) fix invokes `tail +2`. Is that sane to assume for the tests?
It seems so\, in that it worked on both the AIX and HP-UX machines I have access to\, so it doesn't seem to be a recent non-standard flag.
Also works on HP-UX 10.20
as its first line. I've attached the patch below [1] (instead of applying it)\, as I'm not sure whether Perl shouldn't try instead to clean out all locale settings and run its tests under locale "C" to avoid such issues. The alternative would be to force the C locale\, as hinted at in http://perlmonks.org/?node=973418 and also used in t/op/exec.t and t/op/groups.t [2]
$ENV\{LC\_ALL\} = 'C';
I can't test either\, as I cannot replicate the environment.
I think it would be better to clean out the environment. It seems less fragile\, and it's how we're already dealing with this sort of problem.
Frustratingly\, it seems that I can't test this *either*\, as both the systems that I have access to that have a Czech locale available show the first line as "Total". (One being current Ubuntu - I'm surprised that they aren't up to date)
Personally\, I wouldn't put it in the BEGIN block\, although I see that t/op/groups.t does. (t/op/exec.t doesn't). I guess I have this gut feeling that BEGIN blocks are special\, and should only contain things that really need to be done at begin time.
diff --git a/t/op/stat.t b/t/op/stat.t index af1fa5e..3b7a906 100644 --- a/t/op/stat.t +++ b/t/op/stat.t @@ -1\,6 +1\,8 @@ #!./perl
BEGIN { + $ENV{LC_ALL} = "C"; # so that external utilities speak English + $ENV{LANGUAGE} = 'C'; # GNU locale extension chdir 't' if -d 't'; @INC = '../lib'; require './test.pl'; # for which_perl() etc
-- H.Merijn Brand http://tux.nl Perl Monger http://amsterdam.pm.org/ using perl5.00307 .. 5.14 porting perl5 on HP-UX\, AIX\, and openSUSE http://mirrors.develooper.com/hpux/ http://www.test-smoke.org/ http://qa.perl.org http://www.goldmark.org/jeff/stupid-disclaimers/
On Sunday June 3 2012 9:59:53 PM H.Merijn Brand wrote:
On Sun\, 3 Jun 2012 20:49:33 +0100\, Nicholas Clark \nick@​ccl4\.org wrote:
On Sun\, Jun 03\, 2012 at 03:30:16AM -0700\, Max Maischein wrote:
The (tested?) fix invokes `tail +2`. Is that sane to assume for the tests?
It seems so\, in that it worked on both the AIX and HP-UX machines I have access to\, so it doesn't seem to be a recent non-standard flag.
Also works on HP-UX 10.20
I recall having to move from "tail \
On Sun Jun 03 12:50:09 2012\, nicholas wrote:
On Sun\, Jun 03\, 2012 at 03:30:16AM -0700\, Max Maischein wrote:
I can't test either\, as I cannot replicate the environment.
Frustratingly\, it seems that I can't test this *either*\, as both the systems that I have access to that have a Czech locale available show the first line as "Total". (One being current Ubuntu - I'm surprised that they aren't up to date)
I now have access to a machine with Wheezy\, and can replicate it. Fixed in d4046c4813b1f4af
Nicholas Clark
@nwc10 - Status changed from 'open' to 'resolved'
Migrated from rt.perl.org#113472 (status was 'resolved')
Searchable as RT113472$