Skip Menu |

This queue is for tickets about the Statistics-Basic CPAN distribution.

Report information
The Basics
Id: 100943
Status: resolved
Worked: 30 min
Priority: 0/
Queue: Statistics-Basic

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

Bug Information
Severity: (no value)
Broken in: 1.6607
Fixed in: 1.6611



I'm not sure this is worth a ticket. I'm aware SB fails some places, and I think it's ok to let it show the failures on the chart... I'd like to fix this, but I don't have time to look into how to fix it in such a way that it still works in 5.8 (where I don't think there's any locale to worry about?) and also 5.21 where apparently this is a new feature. Do you have any tips on detecting locales and using them for formatting in the tests? On Tue Dec 16 03:04:38 2014, SREZIC wrote: Show quoted text
-- If riding in an airplane is flying, then riding in a boat is swimming. 116 jumps, 48.6 minutes of freefall, 92.9 freefall miles.
On 2014-12-16 08:24:41, JETTERO wrote: Show quoted text
> I'm not sure this is worth a ticket. I'm aware SB fails some places, > and I think it's ok to let it show the failures on the chart... > > > I'd like to fix this, but I don't have time to look into how to fix it > in such a way that it still works in 5.8 (where I don't think there's > any locale to worry about?) and also 5.21 where apparently this is a > new feature. > > Do you have any tips on detecting locales and using them for > formatting in the tests? >
My suggestion: don't try to adapt to the user's locale. Rather set your tests or module code to something predictable, e.g. using $ENV{LC_ALL} = 'C' or POSIX::setlocale(...). Show quoted text
> > On Tue Dec 16 03:04:38 2014, SREZIC wrote:
> > See http://www.cpantesters.org/cpan/report/88d524a8-6322-11e4-b29a- > > 6ad5dfbfc7aa and http://www.cpantesters.org/cpan/report/b3bfbf6a- > > 6f9e- > > 11e4-b46c-c8b510862755 for sample fail reports.
Show quoted text
> My suggestion: don't try to adapt to the user's locale. Rather set > your tests or module code to something predictable, e.g. using > $ENV{LC_ALL} = 'C' or POSIX::setlocale(...).
That's a great idea *and* I can patch that in a few minutes. Thanks. -- If riding in an airplane is flying, then riding in a boat is swimming. 116 jumps, 48.6 minutes of freefall, 92.9 freefall miles.
Should be fixed in 1.6609, assuming I did it right. I bsaically just put LC_ALL at the top of every test. I wanted to do it in the Makefile, but didn't really see an ExtUtils::MakeMaker option for it and it's not clear how to hack it into a makefile rule in the footer … I also wondered if locales are loaded in the BEGIN {} phase of things, so I half expect to need to do a followup tomorrow. -- If riding in an airplane is flying, then riding in a boat is swimming. 116 jumps, 48.6 minutes of freefall, 92.9 freefall miles.
On 2014-12-16 22:37:17, JETTERO wrote: Show quoted text
> Should be fixed in 1.6609, assuming I did it right. I bsaically just > put LC_ALL at the top of every test. I wanted to do it in the > Makefile, but didn't really see an ExtUtils::MakeMaker option for it > and it's not clear how to hack it into a makefile rule in the footer … > > I also wondered if locales are loaded in the BEGIN {} phase of things, > so I half expect to need to do a followup tomorrow.
Unfortunately it did not work, see http://matrix.cpantesters.org/?dist=Statistics-Basic+1.6609 Putting the LC_ALL setting in BEGIN {} also does not work. What works is using POSIX::setlocale, and only if the setlocale() call is in a BEGIN {} block: diff --git i/t/08_filter_outliers.t w/t/08_filter_outliers.t index 30365ea..35fab72 100644 --- i/t/08_filter_outliers.t +++ w/t/08_filter_outliers.t @@ -1,4 +1,4 @@ -$ENV{LC_ALL} = "C"; +use POSIX qw(LC_ALL setlocale); BEGIN { setlocale(LC_ALL, "C"); } use strict; use Test; I am not sure how portable the use of POSIX and POSIX::setlocale is, especially if it works on non-Unix platforms like Windows.
Hrm. There has to be some solution for this. Really, all I'm concerned with is the decimal. I suppose I could simply issue a sample computation and learn it, or disable the number formatting completely for the tests. I'm trying to figure out how to set the locale for my environment so I can break the tests, but I apparently don't remember how to do it. I have to build a locale or something. More later. Never did say: thanks for your time on this. -Paul -- If riding in an airplane is flying, then riding in a boat is swimming. 116 jumps, 48.6 minutes of freefall, 92.9 freefall miles.
OK. 1.6610 sets the offending Number::Format variables manually. In retrospect, I should have loaded Number::Format *BEFORE* I set the vars. *sigh* … I also still can't reproduce your locale, despite spending a good amount of time on it. Vim was all German looking, but perl/N::F didn't seem to care in the slightest. I keep all this on github, so if you want to put anything in the locale_hack that makes it work, I can easily pull from there. https://github.com/jettero/statistics--basic/blob/master/t/locale_hack.pm Thanks again for your time on this, -Paul -- If riding in an airplane is flying, then riding in a boat is swimming. 116 jumps, 48.6 minutes of freefall, 92.9 freefall miles.
On 2014-12-17 07:34:24, JETTERO wrote: Show quoted text
> OK. 1.6610 sets the offending Number::Format variables manually. In > retrospect, I should have loaded Number::Format *BEFORE* I set the > vars. *sigh* … I also still can't reproduce your locale, despite > spending a good amount of time on it. Vim was all German looking, but > perl/N::F didn't seem to care in the slightest.
Remember, it is only bleadperl where it's failing. So you need 5.21.6 or so. Show quoted text
> I keep all this on github, so if you want to put anything in the > locale_hack that makes it work, I can easily pull from there. > > https://github.com/jettero/statistics-- > basic/blob/master/t/locale_hack.pm
See https://github.com/jettero/statistics--basic/pull/2 for a possible solution. Regards, Slaven
Does the current version 1.6611 currently test ok? I think it does… seems ok on the matrix, though the locale_hack may have broken windows. Just the one fail report. I'll leave it for now. -Paul -- If riding in an airplane is flying, then riding in a boat is swimming. 116 jumps, 48.6 minutes of freefall, 92.9 freefall miles.
On 2015-01-09 09:10:45, JETTERO wrote: Show quoted text
> Does the current version 1.6611 currently test ok? I think it does… > seems ok on the matrix, though the locale_hack may have broken > windows. Just the one fail report. I'll leave it for now.
Looks fine now. And there's even one pass report on windows.