Skip Menu |
Report information
Id: 132901
Status: resolved
Priority: 0/
Queue: perl5

Owner: Nobody
Requestors: slaven [at] rezic.de
Cc:
AdminCc:

Operating System: (no value)
PatchStatus: (no value)
Severity: low
Type: unknown
Perl Version: (no value)
Fixed In: (no value)



To: perlbug [...] perl.org
From: slaven [...] rezic.de
Date: Fri, 23 Feb 2018 08:31:17 +0100
Subject: setlocale's return value is broken
CC: srezic [...] cpan.org
Download (untitled) / with headers
text/plain 3.5k
This is a bug report for perl from slaven@rezic.de, generated with the help of perlbug 1.41 running under perl 5.27.9. ----------------------------------------------------------------- On Linux systems (checked CentOS6 and various Debians) the following call returns binary garbage instead of the current locale: $ env LC_ALL=de_DE.UTF-8 perl5.27.9 -MPOSIX=setlocale,LC_ALL -e 'warn setlocale(LC_ALL)' This does not seem to happen if the current locale is C. And I cannot reproduce the problem on FreeBSD systems. The problem does not happen with 5.27.8-157-gef80cd9 or earlier perl versions. (Discovered because the test suite of MSCHOUT/Math-Currency-0.52.tar.gz fails because of this problem). ----------------------------------------------------------------- --- Flags: category=library severity=low module=POSIX --- Site configuration information for perl 5.27.9: Configured by eserte at Tue Feb 20 21:59:42 CET 2018. Summary of my perl5 (revision 5 version 27 subversion 9) configuration: Platform: osname=linux osvers=3.16.0-4-amd64 archname=x86_64-linux uname='linux cabulja 3.16.0-4-amd64 #1 smp debian 3.16.51-3 (2017-12-13) x86_64 gnulinux ' config_args='-ds -e -Dprefix=/opt/perl-5.27.9 -Dusedevel -Dusemallocwrap=no -Dcf_email=srezic@cpan.org' hint=recommended useposix=true d_sigaction=define useithreads=undef usemultiplicity=undef use64bitint=define use64bitall=define uselongdouble=undef usemymalloc=n default_inc_excludes_dot=define bincompat5005=undef Compiler: cc='cc' ccflags ='-fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2' optimize='-O2' cppflags='-fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include' ccversion='' gccversion='4.9.2' gccosandvers='' intsize=4 longsize=8 ptrsize=8 doublesize=8 byteorder=12345678 doublekind=3 d_longlong=define longlongsize=8 d_longdbl=define longdblsize=16 longdblkind=3 ivtype='long' ivsize=8 nvtype='double' nvsize=8 Off_t='off_t' lseeksize=8 alignbytes=8 prototype=define Linker and Libraries: ld='cc' ldflags =' -fstack-protector-strong -L/usr/local/lib' libpth=/usr/local/lib /usr/lib/gcc/x86_64-linux-gnu/4.9/include-fixed /usr/include/x86_64-linux-gnu /usr/lib /lib/x86_64-linux-gnu /lib/../lib /usr/lib/x86_64-linux-gnu /usr/lib/../lib /lib libs=-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc libc=libc-2.19.so so=so useshrplib=false libperl=libperl.a gnulibc_version='2.19' Dynamic Linking: dlsrc=dl_dlopen.xs dlext=so d_dlsymun=undef ccdlflags='-Wl,-E' cccdlflags='-fPIC' lddlflags='-shared -O2 -L/usr/local/lib -fstack-protector-strong' --- @INC for perl 5.27.9: /opt/perl-5.27.9/lib/site_perl/5.27.9/x86_64-linux /opt/perl-5.27.9/lib/site_perl/5.27.9 /opt/perl-5.27.9/lib/5.27.9/x86_64-linux /opt/perl-5.27.9/lib/5.27.9 --- Environment for perl 5.27.9: HOME=/home/eserte LANG=en_US.UTF-8 LANGUAGE (unset) LD_LIBRARY_PATH (unset) LOGDIR (unset) PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/eserte/bin/linux-gnu:/home/eserte/bin/sh:/home/eserte/bin:/home/eserte/bin/pistachio-perl/bin:/usr/games:/home/eserte/devel PERLDOC=-MPod::Perldoc::ToTextOverstrike PERL_BADLANG (unset) SHELL=/bin/zsh
To: perl5-porters [...] perl.org
Subject: Re: [perl #132901] setlocale's return value is broken
Date: Fri, 23 Feb 2018 03:42:28 -0700
From: Karl Williamson <public [...] khwilliamson.com>
Download (untitled) / with headers
text/plain 4.6k
On 02/23/2018 12:33 AM, slaven@rezic.de wrote: Show quoted text
> # New Ticket Created by slaven@rezic.de > # Please include the string: [perl #132901] > # in the subject line of all future correspondence about this issue. > # <URL: https://rt.perl.org/Ticket/Display.html?id=132901 > > > > > This is a bug report for perl from slaven@rezic.de, > generated with the help of perlbug 1.41 running under perl 5.27.9. > > > ----------------------------------------------------------------- > On Linux systems (checked CentOS6 and various Debians) the > following call returns binary garbage instead of the current locale: > > $ env LC_ALL=de_DE.UTF-8 perl5.27.9 -MPOSIX=setlocale,LC_ALL -e 'warn setlocale(LC_ALL)'
I don't get garbage, but I'm not getting the shortest output possible on Ubuntu, which I have a fix for. Please run the following on a DEBUGGING build, and post the output. (The problem will not occur on systems that have querylocale(), nor in locales, such as C, where the radix character is a dot) env LC_ALL=de_DE.UTF-8 env PERL_DEBUG_LOCALE_INIT=1 perl5.27.9 -DLv -MPOSIX=setlocale,LC_ALL -e 'warn setlocale(LC_ALL)' (I don't know the proper syntax of stringing two env's together, so adjust if necessary) Show quoted text
> > This does not seem to happen if the current locale is C. And I cannot > reproduce the problem on FreeBSD systems. > > The problem does not happen with 5.27.8-157-gef80cd9 or earlier perl > versions. > > (Discovered because the test suite of MSCHOUT/Math-Currency-0.52.tar.gz > fails because of this problem). > > ----------------------------------------------------------------- > --- > Flags: > category=library > severity=low > module=POSIX > --- > Site configuration information for perl 5.27.9: > > Configured by eserte at Tue Feb 20 21:59:42 CET 2018. > > Summary of my perl5 (revision 5 version 27 subversion 9) configuration: > > Platform: > osname=linux > osvers=3.16.0-4-amd64 > archname=x86_64-linux > uname='linux cabulja 3.16.0-4-amd64 #1 smp debian 3.16.51-3 (2017-12-13) x86_64 gnulinux ' > config_args='-ds -e -Dprefix=/opt/perl-5.27.9 -Dusedevel -Dusemallocwrap=no -Dcf_email=srezic@cpan.org' > hint=recommended > useposix=true > d_sigaction=define > useithreads=undef > usemultiplicity=undef > use64bitint=define > use64bitall=define > uselongdouble=undef > usemymalloc=n > default_inc_excludes_dot=define > bincompat5005=undef > Compiler: > cc='cc' > ccflags ='-fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2' > optimize='-O2' > cppflags='-fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include' > ccversion='' > gccversion='4.9.2' > gccosandvers='' > intsize=4 > longsize=8 > ptrsize=8 > doublesize=8 > byteorder=12345678 > doublekind=3 > d_longlong=define > longlongsize=8 > d_longdbl=define > longdblsize=16 > longdblkind=3 > ivtype='long' > ivsize=8 > nvtype='double' > nvsize=8 > Off_t='off_t' > lseeksize=8 > alignbytes=8 > prototype=define > Linker and Libraries: > ld='cc' > ldflags =' -fstack-protector-strong -L/usr/local/lib' > libpth=/usr/local/lib /usr/lib/gcc/x86_64-linux-gnu/4.9/include-fixed /usr/include/x86_64-linux-gnu /usr/lib /lib/x86_64-linux-gnu /lib/../lib /usr/lib/x86_64-linux-gnu /usr/lib/../lib /lib > libs=-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat > perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc > libc=libc-2.19.so > so=so > useshrplib=false > libperl=libperl.a > gnulibc_version='2.19' > Dynamic Linking: > dlsrc=dl_dlopen.xs > dlext=so > d_dlsymun=undef > ccdlflags='-Wl,-E' > cccdlflags='-fPIC' > lddlflags='-shared -O2 -L/usr/local/lib -fstack-protector-strong' > > > --- > @INC for perl 5.27.9: > /opt/perl-5.27.9/lib/site_perl/5.27.9/x86_64-linux > /opt/perl-5.27.9/lib/site_perl/5.27.9 > /opt/perl-5.27.9/lib/5.27.9/x86_64-linux > /opt/perl-5.27.9/lib/5.27.9 > > --- > Environment for perl 5.27.9: > HOME=/home/eserte > LANG=en_US.UTF-8 > LANGUAGE (unset) > LD_LIBRARY_PATH (unset) > LOGDIR (unset) > PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/eserte/bin/linux-gnu:/home/eserte/bin/sh:/home/eserte/bin:/home/eserte/bin/pistachio-perl/bin:/usr/games:/home/eserte/devel > PERLDOC=-MPod::Perldoc::ToTextOverstrike > PERL_BADLANG (unset) > SHELL=/bin/zsh > >
To: Karl Williamson <public [...] khwilliamson.com>
Date: Fri, 23 Feb 2018 22:41:54 +0100
From: Slaven Rezic <slaven [...] rezic.de>
Subject: Re: [perl #132901] setlocale's return value is broken
CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 4.8k
Karl Williamson <public@khwilliamson.com> writes: Show quoted text
> On 02/23/2018 12:33 AM, slaven@rezic.de wrote:
>> # New Ticket Created by slaven@rezic.de >> # Please include the string: [perl #132901] >> # in the subject line of all future correspondence about this issue. >> # <URL: https://rt.perl.org/Ticket/Display.html?id=132901 > >> >> >> >> This is a bug report for perl from slaven@rezic.de, >> generated with the help of perlbug 1.41 running under perl 5.27.9. >> >> >> ----------------------------------------------------------------- >> On Linux systems (checked CentOS6 and various Debians) the >> following call returns binary garbage instead of the current locale: >> >> $ env LC_ALL=de_DE.UTF-8 perl5.27.9 -MPOSIX=setlocale,LC_ALL -e 'warn setlocale(LC_ALL)'
> > I don't get garbage, but I'm not getting the shortest output possible > on Ubuntu, which I have a fix for. > > Please run the following on a DEBUGGING build, and post the output. > (The problem will not occur on systems that have querylocale(), nor in > locales, such as C, where the radix character is a dot) > > env LC_ALL=de_DE.UTF-8 env PERL_DEBUG_LOCALE_INIT=1 perl5.27.9 -DLv > -MPOSIX=setlocale,LC_ALL -e 'warn setlocale(LC_ALL)' > > (I don't know the proper syntax of stringing two env's together, so > adjust if necessary)
Attached. This is with a slightly newer perl than 5.27.9 (d3a1131). Regards, Slaven Show quoted text
>> >> This does not seem to happen if the current locale is C. And I cannot >> reproduce the problem on FreeBSD systems. >> >> The problem does not happen with 5.27.8-157-gef80cd9 or earlier perl >> versions. >> >> (Discovered because the test suite of MSCHOUT/Math-Currency-0.52.tar.gz >> fails because of this problem). >> >> ----------------------------------------------------------------- >> --- >> Flags: >> category=library >> severity=low >> module=POSIX >> --- >> Site configuration information for perl 5.27.9: >> >> Configured by eserte at Tue Feb 20 21:59:42 CET 2018. >> >> Summary of my perl5 (revision 5 version 27 subversion 9) configuration: >> Platform: >> osname=linux >> osvers=3.16.0-4-amd64 >> archname=x86_64-linux >> uname='linux cabulja 3.16.0-4-amd64 #1 smp debian 3.16.51-3 (2017-12-13) x86_64 gnulinux ' >> config_args='-ds -e -Dprefix=/opt/perl-5.27.9 -Dusedevel -Dusemallocwrap=no -Dcf_email=srezic@cpan.org' >> hint=recommended >> useposix=true >> d_sigaction=define >> useithreads=undef >> usemultiplicity=undef >> use64bitint=define >> use64bitall=define >> uselongdouble=undef >> usemymalloc=n >> default_inc_excludes_dot=define >> bincompat5005=undef >> Compiler: >> cc='cc' >> ccflags ='-fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2' >> optimize='-O2' >> cppflags='-fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include' >> ccversion='' >> gccversion='4.9.2' >> gccosandvers='' >> intsize=4 >> longsize=8 >> ptrsize=8 >> doublesize=8 >> byteorder=12345678 >> doublekind=3 >> d_longlong=define >> longlongsize=8 >> d_longdbl=define >> longdblsize=16 >> longdblkind=3 >> ivtype='long' >> ivsize=8 >> nvtype='double' >> nvsize=8 >> Off_t='off_t' >> lseeksize=8 >> alignbytes=8 >> prototype=define >> Linker and Libraries: >> ld='cc' >> ldflags =' -fstack-protector-strong -L/usr/local/lib' >> libpth=/usr/local/lib /usr/lib/gcc/x86_64-linux-gnu/4.9/include-fixed /usr/include/x86_64-linux-gnu /usr/lib /lib/x86_64-linux-gnu /lib/../lib /usr/lib/x86_64-linux-gnu /usr/lib/../lib /lib >> libs=-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat >> perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc >> libc=libc-2.19.so >> so=so >> useshrplib=false >> libperl=libperl.a >> gnulibc_version='2.19' >> Dynamic Linking: >> dlsrc=dl_dlopen.xs >> dlext=so >> d_dlsymun=undef >> ccdlflags='-Wl,-E' >> cccdlflags='-fPIC' >> lddlflags='-shared -O2 -L/usr/local/lib -fstack-protector-strong' >> >> >> --- >> @INC for perl 5.27.9: >> /opt/perl-5.27.9/lib/site_perl/5.27.9/x86_64-linux >> /opt/perl-5.27.9/lib/site_perl/5.27.9 >> /opt/perl-5.27.9/lib/5.27.9/x86_64-linux >> /opt/perl-5.27.9/lib/5.27.9 >> >> --- >> Environment for perl 5.27.9: >> HOME=/home/eserte >> LANG=en_US.UTF-8 >> LANGUAGE (unset) >> LD_LIBRARY_PATH (unset) >> LOGDIR (unset) >> PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/eserte/bin/linux-gnu:/home/eserte/bin/sh:/home/eserte/bin:/home/eserte/bin/pistachio-perl/bin:/usr/games:/home/eserte/devel >> PERLDOC=-MPod::Perldoc::ToTextOverstrike >> PERL_BADLANG (unset) >> SHELL=/bin/zsh >> >>
Download 132901-5.27.8-363-gd3a1131.log.bz2
application/octet-stream 39.4k

Message body not shown because it is not plain text.

-- Slaven Rezic - slaven <at> rezic <dot> de Berlin Perl Mongers - http://berlin.pm.org
Subject: Re: [perl #132901] setlocale's return value is broken
Date: Fri, 23 Feb 2018 16:57:51 -0700
To: slaven [...] rezic.de
CC: perl5-porters [...] perl.org
From: Karl Williamson <public [...] khwilliamson.com>
Download (untitled) / with headers
text/plain 5.3k
On 02/23/2018 02:41 PM, Slaven Rezic wrote: Show quoted text
> Karl Williamson <public@khwilliamson.com> writes: >
>> On 02/23/2018 12:33 AM, slaven@rezic.de wrote:
>>> # New Ticket Created by slaven@rezic.de >>> # Please include the string: [perl #132901] >>> # in the subject line of all future correspondence about this issue. >>> # <URL: https://rt.perl.org/Ticket/Display.html?id=132901 > >>> >>> >>> >>> This is a bug report for perl from slaven@rezic.de, >>> generated with the help of perlbug 1.41 running under perl 5.27.9. >>> >>> >>> ----------------------------------------------------------------- >>> On Linux systems (checked CentOS6 and various Debians) the >>> following call returns binary garbage instead of the current locale: >>> >>> $ env LC_ALL=de_DE.UTF-8 perl5.27.9 -MPOSIX=setlocale,LC_ALL -e 'warn setlocale(LC_ALL)'
>> >> I don't get garbage, but I'm not getting the shortest output possible >> on Ubuntu, which I have a fix for. >> >> Please run the following on a DEBUGGING build, and post the output. >> (The problem will not occur on systems that have querylocale(), nor in >> locales, such as C, where the radix character is a dot) >> >> env LC_ALL=de_DE.UTF-8 env PERL_DEBUG_LOCALE_INIT=1 perl5.27.9 -DLv >> -MPOSIX=setlocale,LC_ALL -e 'warn setlocale(LC_ALL)' >> >> (I don't know the proper syntax of stringing two env's together, so >> adjust if necessary)
> > Attached. This is with a slightly newer perl than 5.27.9 (d3a1131).
Unfortunately the logging option you selected was lowercase 'l' instead of uppercase, and so its the wrong information. You might want to try instead doing a checkout of smoke-me/khw-locale, which has several bug fixes related to locales. Show quoted text
> > Regards, > Slaven >
>>> >>> This does not seem to happen if the current locale is C. And I cannot >>> reproduce the problem on FreeBSD systems. >>> >>> The problem does not happen with 5.27.8-157-gef80cd9 or earlier perl >>> versions. >>> >>> (Discovered because the test suite of MSCHOUT/Math-Currency-0.52.tar.gz >>> fails because of this problem). >>> >>> ----------------------------------------------------------------- >>> --- >>> Flags: >>> category=library >>> severity=low >>> module=POSIX >>> --- >>> Site configuration information for perl 5.27.9: >>> >>> Configured by eserte at Tue Feb 20 21:59:42 CET 2018. >>> >>> Summary of my perl5 (revision 5 version 27 subversion 9) configuration: >>> Platform: >>> osname=linux >>> osvers=3.16.0-4-amd64 >>> archname=x86_64-linux >>> uname='linux cabulja 3.16.0-4-amd64 #1 smp debian 3.16.51-3 (2017-12-13) x86_64 gnulinux ' >>> config_args='-ds -e -Dprefix=/opt/perl-5.27.9 -Dusedevel -Dusemallocwrap=no -Dcf_email=srezic@cpan.org' >>> hint=recommended >>> useposix=true >>> d_sigaction=define >>> useithreads=undef >>> usemultiplicity=undef >>> use64bitint=define >>> use64bitall=define >>> uselongdouble=undef >>> usemymalloc=n >>> default_inc_excludes_dot=define >>> bincompat5005=undef >>> Compiler: >>> cc='cc' >>> ccflags ='-fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2' >>> optimize='-O2' >>> cppflags='-fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include' >>> ccversion='' >>> gccversion='4.9.2' >>> gccosandvers='' >>> intsize=4 >>> longsize=8 >>> ptrsize=8 >>> doublesize=8 >>> byteorder=12345678 >>> doublekind=3 >>> d_longlong=define >>> longlongsize=8 >>> d_longdbl=define >>> longdblsize=16 >>> longdblkind=3 >>> ivtype='long' >>> ivsize=8 >>> nvtype='double' >>> nvsize=8 >>> Off_t='off_t' >>> lseeksize=8 >>> alignbytes=8 >>> prototype=define >>> Linker and Libraries: >>> ld='cc' >>> ldflags =' -fstack-protector-strong -L/usr/local/lib' >>> libpth=/usr/local/lib /usr/lib/gcc/x86_64-linux-gnu/4.9/include-fixed /usr/include/x86_64-linux-gnu /usr/lib /lib/x86_64-linux-gnu /lib/../lib /usr/lib/x86_64-linux-gnu /usr/lib/../lib /lib >>> libs=-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat >>> perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc >>> libc=libc-2.19.so >>> so=so >>> useshrplib=false >>> libperl=libperl.a >>> gnulibc_version='2.19' >>> Dynamic Linking: >>> dlsrc=dl_dlopen.xs >>> dlext=so >>> d_dlsymun=undef >>> ccdlflags='-Wl,-E' >>> cccdlflags='-fPIC' >>> lddlflags='-shared -O2 -L/usr/local/lib -fstack-protector-strong' >>> >>> >>> --- >>> @INC for perl 5.27.9: >>> /opt/perl-5.27.9/lib/site_perl/5.27.9/x86_64-linux >>> /opt/perl-5.27.9/lib/site_perl/5.27.9 >>> /opt/perl-5.27.9/lib/5.27.9/x86_64-linux >>> /opt/perl-5.27.9/lib/5.27.9 >>> >>> --- >>> Environment for perl 5.27.9: >>> HOME=/home/eserte >>> LANG=en_US.UTF-8 >>> LANGUAGE (unset) >>> LD_LIBRARY_PATH (unset) >>> LOGDIR (unset) >>> PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/eserte/bin/linux-gnu:/home/eserte/bin/sh:/home/eserte/bin:/home/eserte/bin/pistachio-perl/bin:/usr/games:/home/eserte/devel >>> PERLDOC=-MPod::Perldoc::ToTextOverstrike >>> PERL_BADLANG (unset) >>> SHELL=/bin/zsh >>> >>>
> > > >
Subject: Re: [perl #132901] setlocale's return value is broken
From: Slaven Rezic <slaven [...] rezic.de>
Date: Sat, 24 Feb 2018 10:00:45 +0100
To: Karl Williamson <public [...] khwilliamson.com>
CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 5.8k
Karl Williamson <public@khwilliamson.com> writes: Show quoted text
> On 02/23/2018 02:41 PM, Slaven Rezic wrote:
>> Karl Williamson <public@khwilliamson.com> writes: >>
>>> On 02/23/2018 12:33 AM, slaven@rezic.de wrote:
>>>> # New Ticket Created by slaven@rezic.de >>>> # Please include the string: [perl #132901] >>>> # in the subject line of all future correspondence about this issue. >>>> # <URL: https://rt.perl.org/Ticket/Display.html?id=132901 > >>>> >>>> >>>> >>>> This is a bug report for perl from slaven@rezic.de, >>>> generated with the help of perlbug 1.41 running under perl 5.27.9. >>>> >>>> >>>> ----------------------------------------------------------------- >>>> On Linux systems (checked CentOS6 and various Debians) the >>>> following call returns binary garbage instead of the current locale: >>>> >>>> $ env LC_ALL=de_DE.UTF-8 perl5.27.9 -MPOSIX=setlocale,LC_ALL -e 'warn setlocale(LC_ALL)'
>>> >>> I don't get garbage, but I'm not getting the shortest output possible >>> on Ubuntu, which I have a fix for. >>> >>> Please run the following on a DEBUGGING build, and post the output. >>> (The problem will not occur on systems that have querylocale(), nor in >>> locales, such as C, where the radix character is a dot) >>> >>> env LC_ALL=de_DE.UTF-8 env PERL_DEBUG_LOCALE_INIT=1 perl5.27.9 -DLv >>> -MPOSIX=setlocale,LC_ALL -e 'warn setlocale(LC_ALL)' >>> >>> (I don't know the proper syntax of stringing two env's together, so >>> adjust if necessary)
>> >> Attached. This is with a slightly newer perl than 5.27.9 (d3a1131).
> > Unfortunately the logging option you selected was lowercase 'l' > instead of uppercase, and so its the wrong information. You might > want to try instead doing a checkout of smoke-me/khw-locale, which has > several bug fixes related to locales.
2nd try, using the smoke-me/khw-locale branch and running env LC_ALL=de_DE.UTF-8 PERL_DEBUG_LOCALE_INIT=1 LD_LIBRARY_PATH=$(pwd) ./perl -Ilib -DLv -MPOSIX=setlocale,LC_ALL -e 'warn setlocale(LC_ALL)' >& /tmp/132901-khw-locale.log Log attached. Show quoted text
>> >> Regards, >> Slaven >>
>>>> >>>> This does not seem to happen if the current locale is C. And I cannot >>>> reproduce the problem on FreeBSD systems. >>>> >>>> The problem does not happen with 5.27.8-157-gef80cd9 or earlier perl >>>> versions. >>>> >>>> (Discovered because the test suite of MSCHOUT/Math-Currency-0.52.tar.gz >>>> fails because of this problem). >>>> >>>> ----------------------------------------------------------------- >>>> --- >>>> Flags: >>>> category=library >>>> severity=low >>>> module=POSIX >>>> --- >>>> Site configuration information for perl 5.27.9: >>>> >>>> Configured by eserte at Tue Feb 20 21:59:42 CET 2018. >>>> >>>> Summary of my perl5 (revision 5 version 27 subversion 9) configuration: >>>> Platform: >>>> osname=linux >>>> osvers=3.16.0-4-amd64 >>>> archname=x86_64-linux >>>> uname='linux cabulja 3.16.0-4-amd64 #1 smp debian 3.16.51-3 (2017-12-13) x86_64 gnulinux ' >>>> config_args='-ds -e -Dprefix=/opt/perl-5.27.9 -Dusedevel -Dusemallocwrap=no -Dcf_email=srezic@cpan.org' >>>> hint=recommended >>>> useposix=true >>>> d_sigaction=define >>>> useithreads=undef >>>> usemultiplicity=undef >>>> use64bitint=define >>>> use64bitall=define >>>> uselongdouble=undef >>>> usemymalloc=n >>>> default_inc_excludes_dot=define >>>> bincompat5005=undef >>>> Compiler: >>>> cc='cc' >>>> ccflags ='-fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2' >>>> optimize='-O2' >>>> cppflags='-fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include' >>>> ccversion='' >>>> gccversion='4.9.2' >>>> gccosandvers='' >>>> intsize=4 >>>> longsize=8 >>>> ptrsize=8 >>>> doublesize=8 >>>> byteorder=12345678 >>>> doublekind=3 >>>> d_longlong=define >>>> longlongsize=8 >>>> d_longdbl=define >>>> longdblsize=16 >>>> longdblkind=3 >>>> ivtype='long' >>>> ivsize=8 >>>> nvtype='double' >>>> nvsize=8 >>>> Off_t='off_t' >>>> lseeksize=8 >>>> alignbytes=8 >>>> prototype=define >>>> Linker and Libraries: >>>> ld='cc' >>>> ldflags =' -fstack-protector-strong -L/usr/local/lib' >>>> libpth=/usr/local/lib /usr/lib/gcc/x86_64-linux-gnu/4.9/include-fixed /usr/include/x86_64-linux-gnu /usr/lib /lib/x86_64-linux-gnu /lib/../lib /usr/lib/x86_64-linux-gnu /usr/lib/../lib /lib >>>> libs=-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat >>>> perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc >>>> libc=libc-2.19.so >>>> so=so >>>> useshrplib=false >>>> libperl=libperl.a >>>> gnulibc_version='2.19' >>>> Dynamic Linking: >>>> dlsrc=dl_dlopen.xs >>>> dlext=so >>>> d_dlsymun=undef >>>> ccdlflags='-Wl,-E' >>>> cccdlflags='-fPIC' >>>> lddlflags='-shared -O2 -L/usr/local/lib -fstack-protector-strong' >>>> >>>> >>>> --- >>>> @INC for perl 5.27.9: >>>> /opt/perl-5.27.9/lib/site_perl/5.27.9/x86_64-linux >>>> /opt/perl-5.27.9/lib/site_perl/5.27.9 >>>> /opt/perl-5.27.9/lib/5.27.9/x86_64-linux >>>> /opt/perl-5.27.9/lib/5.27.9 >>>> >>>> --- >>>> Environment for perl 5.27.9: >>>> HOME=/home/eserte >>>> LANG=en_US.UTF-8 >>>> LANGUAGE (unset) >>>> LD_LIBRARY_PATH (unset) >>>> LOGDIR (unset) >>>> PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/eserte/bin/linux-gnu:/home/eserte/bin/sh:/home/eserte/bin:/home/eserte/bin/pistachio-perl/bin:/usr/games:/home/eserte/devel >>>> PERLDOC=-MPod::Perldoc::ToTextOverstrike >>>> PERL_BADLANG (unset) >>>> SHELL=/bin/zsh >>>> >>>>
>> >> >> >>
Download 132901-khw-locale.log
application/octet-stream 3k

Message body not shown because it is not plain text.

-- Slaven Rezic - slaven <at> rezic <dot> de Berlin Perl Mongers - http://berlin.pm.org
From: Karl Williamson <public [...] khwilliamson.com>
Date: Sat, 24 Feb 2018 13:14:45 -0700
Subject: Re: [perl #132901] setlocale's return value is broken
To: slaven [...] rezic.de
CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 2.7k
On 02/24/2018 02:00 AM, Slaven Rezic wrote: Show quoted text
> Karl Williamson <public@khwilliamson.com> writes: >
>> On 02/23/2018 02:41 PM, Slaven Rezic wrote:
>>> Karl Williamson <public@khwilliamson.com> writes: >>>
>>>> On 02/23/2018 12:33 AM, slaven@rezic.de wrote:
>>>>> # New Ticket Created by slaven@rezic.de >>>>> # Please include the string: [perl #132901] >>>>> # in the subject line of all future correspondence about this issue. >>>>> # <URL: https://rt.perl.org/Ticket/Display.html?id=132901 > >>>>> >>>>> >>>>> >>>>> This is a bug report for perl from slaven@rezic.de, >>>>> generated with the help of perlbug 1.41 running under perl 5.27.9. >>>>> >>>>> >>>>> ----------------------------------------------------------------- >>>>> On Linux systems (checked CentOS6 and various Debians) the >>>>> following call returns binary garbage instead of the current locale: >>>>> >>>>> $ env LC_ALL=de_DE.UTF-8 perl5.27.9 -MPOSIX=setlocale,LC_ALL -e 'warn setlocale(LC_ALL)'
>>>> >>>> I don't get garbage, but I'm not getting the shortest output possible >>>> on Ubuntu, which I have a fix for. >>>> >>>> Please run the following on a DEBUGGING build, and post the output. >>>> (The problem will not occur on systems that have querylocale(), nor in >>>> locales, such as C, where the radix character is a dot) >>>> >>>> env LC_ALL=de_DE.UTF-8 env PERL_DEBUG_LOCALE_INIT=1 perl5.27.9 -DLv >>>> -MPOSIX=setlocale,LC_ALL -e 'warn setlocale(LC_ALL)' >>>> >>>> (I don't know the proper syntax of stringing two env's together, so >>>> adjust if necessary)
>>> >>> Attached. This is with a slightly newer perl than 5.27.9 (d3a1131).
>> >> Unfortunately the logging option you selected was lowercase 'l' >> instead of uppercase, and so its the wrong information. You might >> want to try instead doing a checkout of smoke-me/khw-locale, which has >> several bug fixes related to locales.
> > 2nd try, using the smoke-me/khw-locale branch and running > > env LC_ALL=de_DE.UTF-8 PERL_DEBUG_LOCALE_INIT=1 LD_LIBRARY_PATH=$(pwd) ./perl -Ilib -DLv -MPOSIX=setlocale,LC_ALL -e 'warn setlocale(LC_ALL)' >& /tmp/132901-khw-locale.log
Show quoted text
> > Log attached.
Please send me config.h for this system Show quoted text
>>> >>> Regards, >>> Slaven >>>
>>>>> >>>>> This does not seem to happen if the current locale is C. And I cannot >>>>> reproduce the problem on FreeBSD systems. >>>>> >>>>> The problem does not happen with 5.27.8-157-gef80cd9 or earlier perl >>>>> versions. >>>>> >>>>> (Discovered because the test suite of MSCHOUT/Math-Currency-0.52.tar.gz >>>>> fails because of this problem). >>>>> >>>>> ----------------------------------------------------------------- >>>>> --- >>>>> Flags: >>>>> category=library >>>>> severity=low >>>>> module=POSIX >>>>> ---
From: Karl Williamson <public [...] khwilliamson.com>
To: slaven [...] rezic.de
Date: Sat, 24 Feb 2018 22:18:34 -0700
Subject: Re: [perl #132901] setlocale's return value is broken
CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 766b
On 02/24/2018 01:14 PM, Karl Williamson wrote: Show quoted text
> On 02/24/2018 02:00 AM, Slaven Rezic wrote:
>> Karl Williamson <public@khwilliamson.com> writes: >>
>>> On 02/23/2018 02:41 PM, Slaven Rezic wrote:
>>>> Karl Williamson <public@khwilliamson.com> writes: >>>>
>>>>> On 02/23/2018 12:33 AM, slaven@rezic.de wrote:
>>>>>> # New Ticket Created by  slaven@rezic.de >>>>>> # Please include the string:  [perl #132901] >>>>>> # in the subject line of all future correspondence about this issue. >>>>>> # <URL: https://rt.perl.org/Ticket/Display.html?id=132901 > >>>>>> >>>>>> >>>>>> >>>>>> This is a bug report for perl from slaven@rezic.de, >>>>>> generated with the help of perlbug 1.41 running under perl 5.27.9. >>>>>>
I believe this is fixed in blead; please verify.
Date: Sun, 25 Feb 2018 11:03:10 +0100
Subject: Re: [perl #132901] setlocale's return value is broken
To: "karl williamson via RT" <perlbug-followup [...] perl.org>
From: Slaven Rezic <slaven [...] rezic.de>
Download (untitled) / with headers
text/plain 1.4k
"karl williamson via RT" <perlbug-followup@perl.org> writes: Show quoted text
> On 02/24/2018 01:14 PM, Karl Williamson wrote:
>> On 02/24/2018 02:00 AM, Slaven Rezic wrote:
>>> Karl Williamson <public@khwilliamson.com> writes: >>>
>>>> On 02/23/2018 02:41 PM, Slaven Rezic wrote:
>>>>> Karl Williamson <public@khwilliamson.com> writes: >>>>>
>>>>>> On 02/23/2018 12:33 AM, slaven@rezic.de wrote:
>>>>>>> # New Ticket Created by  slaven@rezic.de >>>>>>> # Please include the string:  [perl #132901] >>>>>>> # in the subject line of all future correspondence about this issue. >>>>>>> # <URL: https://rt.perl.org/Ticket/Display.html?id=132901 > >>>>>>> >>>>>>> >>>>>>> >>>>>>> This is a bug report for perl from slaven@rezic.de, >>>>>>> generated with the help of perlbug 1.41 running under perl 5.27.9. >>>>>>>
> > I believe this is fixed in blead; please verify. >
No, it's still not fixed: $ env LC_ALL=de_DE.UTF-8 ./perl -Ilib -MTest::More=no_plan -MPOSIX=setlocale,LC_ALL -e 'is setlocale(LC_ALL), "de_DE.UTF-8"' not ok 1 # Failed test at -e line 1. # got: '�^' # expected: 'de_DE.UTF-8' 1..1 # Looks like you failed 1 test of 1. $ env LC_ALL=de_DE.UTF-8 ./perl -Ilib -V|grep Commit.id Commit id: c1cc29fd0c75ba66cac01113aa5a22009dcea306 -- Slaven Rezic - slaven <at> rezic <dot> de BBBike - route planner for cyclists in Berlin WWW version: http://www.bbbike.de Perl/Tk version for Unix and Windows: http://bbbike.sourceforge.net
Subject: Re: [perl #132901] setlocale's return value is broken
Date: Sun, 25 Feb 2018 09:12:53 -0700
To: slaven [...] rezic.de, karl williamson via RT <perlbug-followup [...] perl.org>
From: Karl Williamson <public [...] khwilliamson.com>
Download (untitled) / with headers
text/plain 1.5k
On 02/25/2018 03:03 AM, Slaven Rezic wrote: Show quoted text
> "karl williamson via RT" <perlbug-followup@perl.org> writes: >
>> On 02/24/2018 01:14 PM, Karl Williamson wrote:
>>> On 02/24/2018 02:00 AM, Slaven Rezic wrote:
>>>> Karl Williamson <public@khwilliamson.com> writes: >>>>
>>>>> On 02/23/2018 02:41 PM, Slaven Rezic wrote:
>>>>>> Karl Williamson <public@khwilliamson.com> writes: >>>>>>
>>>>>>> On 02/23/2018 12:33 AM, slaven@rezic.de wrote:
>>>>>>>> # New Ticket Created by  slaven@rezic.de >>>>>>>> # Please include the string:  [perl #132901] >>>>>>>> # in the subject line of all future correspondence about this issue. >>>>>>>> # <URL: https://rt.perl.org/Ticket/Display.html?id=132901 > >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> This is a bug report for perl from slaven@rezic.de, >>>>>>>> generated with the help of perlbug 1.41 running under perl 5.27.9. >>>>>>>>
>> >> I believe this is fixed in blead; please verify. >>
> > No, it's still not fixed: > > $ env LC_ALL=de_DE.UTF-8 ./perl -Ilib -MTest::More=no_plan -MPOSIX=setlocale,LC_ALL -e 'is setlocale(LC_ALL), "de_DE.UTF-8"' > not ok 1 > # Failed test at -e line 1. > # got: '�^' > # expected: 'de_DE.UTF-8' > 1..1 > # Looks like you failed 1 test of 1. > > $ env LC_ALL=de_DE.UTF-8 ./perl -Ilib -V|grep Commit.id > Commit id: c1cc29fd0c75ba66cac01113aa5a22009dcea306 >
Sorry, somehow not all the commits I intended to push actually got pushed. The commit I believe will fix the problem is 7a60910d1bd9081951d3509805c035b0c4bcbe79 And, yes, I will add a test
From: Slaven Rezic <slaven [...] rezic.de>
CC: karl williamson via RT <perlbug-followup [...] perl.org>
To: Karl Williamson <public [...] khwilliamson.com>
Subject: Re: [perl #132901] setlocale's return value is broken
Date: Sun, 25 Feb 2018 17:26:00 +0100
Download (untitled) / with headers
text/plain 1.8k
Karl Williamson <public@khwilliamson.com> writes: Show quoted text
> On 02/25/2018 03:03 AM, Slaven Rezic wrote:
>> "karl williamson via RT" <perlbug-followup@perl.org> writes: >>
>>> On 02/24/2018 01:14 PM, Karl Williamson wrote:
>>>> On 02/24/2018 02:00 AM, Slaven Rezic wrote:
>>>>> Karl Williamson <public@khwilliamson.com> writes: >>>>>
>>>>>> On 02/23/2018 02:41 PM, Slaven Rezic wrote:
>>>>>>> Karl Williamson <public@khwilliamson.com> writes: >>>>>>>
>>>>>>>> On 02/23/2018 12:33 AM, slaven@rezic.de wrote:
>>>>>>>>> # New Ticket Created by  slaven@rezic.de >>>>>>>>> # Please include the string:  [perl #132901] >>>>>>>>> # in the subject line of all future correspondence about this issue. >>>>>>>>> # <URL: https://rt.perl.org/Ticket/Display.html?id=132901 > >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> This is a bug report for perl from slaven@rezic.de, >>>>>>>>> generated with the help of perlbug 1.41 running under perl 5.27.9. >>>>>>>>>
>>> >>> I believe this is fixed in blead; please verify. >>>
>> >> No, it's still not fixed: >> >> $ env LC_ALL=de_DE.UTF-8 ./perl -Ilib -MTest::More=no_plan -MPOSIX=setlocale,LC_ALL -e 'is setlocale(LC_ALL), "de_DE.UTF-8"' >> not ok 1 >> # Failed test at -e line 1. >> # got: '�^' >> # expected: 'de_DE.UTF-8' >> 1..1 >> # Looks like you failed 1 test of 1. >> >> $ env LC_ALL=de_DE.UTF-8 ./perl -Ilib -V|grep Commit.id >> Commit id: c1cc29fd0c75ba66cac01113aa5a22009dcea306 >>
> > Sorry, somehow not all the commits I intended to push actually got > pushed. The commit I believe will fix the problem is > 7a60910d1bd9081951d3509805c035b0c4bcbe79
It's still not pushed: $ git fetch && git checkout 7a60910d1bd9081951d3509805c035b0c4bcbe79 fatal: reference is not a tree: 7a60910d1bd9081951d3509805c035b0c4bcbe79 Show quoted text
> > And, yes, I will add a test
-- Slaven Rezic - slaven <at> rezic <dot> de Berlin Perl Mongers - http://berlin.pm.org
Date: Sun, 25 Feb 2018 09:50:25 -0700
Subject: Re: [perl #132901] setlocale's return value is broken
To: slaven [...] rezic.de
CC: karl williamson via RT <perlbug-followup [...] perl.org>
From: Karl Williamson <public [...] khwilliamson.com>
On 02/25/2018 09:26 AM, Slaven Rezic wrote: Show quoted text
> Karl Williamson <public@khwilliamson.com> writes: >
>> On 02/25/2018 03:03 AM, Slaven Rezic wrote:
>>> "karl williamson via RT" <perlbug-followup@perl.org> writes: >>>
>>>> On 02/24/2018 01:14 PM, Karl Williamson wrote:
>>>>> On 02/24/2018 02:00 AM, Slaven Rezic wrote:
>>>>>> Karl Williamson <public@khwilliamson.com> writes: >>>>>>
>>>>>>> On 02/23/2018 02:41 PM, Slaven Rezic wrote:
>>>>>>>> Karl Williamson <public@khwilliamson.com> writes: >>>>>>>>
>>>>>>>>> On 02/23/2018 12:33 AM, slaven@rezic.de wrote:
>>>>>>>>>> # New Ticket Created by  slaven@rezic.de >>>>>>>>>> # Please include the string:  [perl #132901] >>>>>>>>>> # in the subject line of all future correspondence about this issue. >>>>>>>>>> # <URL: https://rt.perl.org/Ticket/Display.html?id=132901 > >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> This is a bug report for perl from slaven@rezic.de, >>>>>>>>>> generated with the help of perlbug 1.41 running under perl 5.27.9. >>>>>>>>>>
>>>> >>>> I believe this is fixed in blead; please verify. >>>>
>>> >>> No, it's still not fixed: >>> >>> $ env LC_ALL=de_DE.UTF-8 ./perl -Ilib -MTest::More=no_plan -MPOSIX=setlocale,LC_ALL -e 'is setlocale(LC_ALL), "de_DE.UTF-8"' >>> not ok 1 >>> # Failed test at -e line 1. >>> # got: '�^' >>> # expected: 'de_DE.UTF-8' >>> 1..1 >>> # Looks like you failed 1 test of 1. >>> >>> $ env LC_ALL=de_DE.UTF-8 ./perl -Ilib -V|grep Commit.id >>> Commit id: c1cc29fd0c75ba66cac01113aa5a22009dcea306 >>>
>> >> Sorry, somehow not all the commits I intended to push actually got >> pushed. The commit I believe will fix the problem is >> 7a60910d1bd9081951d3509805c035b0c4bcbe79
> > It's still not pushed: > > $ git fetch && git checkout 7a60910d1bd9081951d3509805c035b0c4bcbe79 > fatal: reference is not a tree: 7a60910d1bd9081951d3509805c035b0c4bcbe79
Embarrassingly, I guess the push failed, and I didn't look carefully. Now, it definitely is, as 33e5a354e61aad64afe0e1a4f53773e8547515bf Show quoted text
>
>> >> And, yes, I will add a test
>
Subject: Re: [perl #132901] setlocale's return value is broken
Date: Sun, 25 Feb 2018 18:21:54 +0100
To: "karl williamson via RT" <perlbug-followup [...] perl.org>
From: Slaven Rezic <slaven [...] rezic.de>
Download (untitled) / with headers
text/plain 2.2k
"karl williamson via RT" <perlbug-followup@perl.org> writes: Show quoted text
> On 02/25/2018 09:26 AM, Slaven Rezic wrote:
>> Karl Williamson <public@khwilliamson.com> writes: >>
>>> On 02/25/2018 03:03 AM, Slaven Rezic wrote:
>>>> "karl williamson via RT" <perlbug-followup@perl.org> writes: >>>>
>>>>> On 02/24/2018 01:14 PM, Karl Williamson wrote:
>>>>>> On 02/24/2018 02:00 AM, Slaven Rezic wrote:
>>>>>>> Karl Williamson <public@khwilliamson.com> writes: >>>>>>>
>>>>>>>> On 02/23/2018 02:41 PM, Slaven Rezic wrote:
>>>>>>>>> Karl Williamson <public@khwilliamson.com> writes: >>>>>>>>>
>>>>>>>>>> On 02/23/2018 12:33 AM, slaven@rezic.de wrote:
>>>>>>>>>>> # New Ticket Created by  slaven@rezic.de >>>>>>>>>>> # Please include the string:  [perl #132901] >>>>>>>>>>> # in the subject line of all future correspondence about this issue. >>>>>>>>>>> # <URL: https://rt.perl.org/Ticket/Display.html?id=132901 > >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> This is a bug report for perl from slaven@rezic.de, >>>>>>>>>>> generated with the help of perlbug 1.41 running under perl 5.27.9. >>>>>>>>>>>
>>>>> >>>>> I believe this is fixed in blead; please verify. >>>>>
>>>> >>>> No, it's still not fixed: >>>> >>>> $ env LC_ALL=de_DE.UTF-8 ./perl -Ilib -MTest::More=no_plan -MPOSIX=setlocale,LC_ALL -e 'is setlocale(LC_ALL), "de_DE.UTF-8"' >>>> not ok 1 >>>> # Failed test at -e line 1. >>>> # got: '�^' >>>> # expected: 'de_DE.UTF-8' >>>> 1..1 >>>> # Looks like you failed 1 test of 1. >>>> >>>> $ env LC_ALL=de_DE.UTF-8 ./perl -Ilib -V|grep Commit.id >>>> Commit id: c1cc29fd0c75ba66cac01113aa5a22009dcea306 >>>>
>>> >>> Sorry, somehow not all the commits I intended to push actually got >>> pushed. The commit I believe will fix the problem is >>> 7a60910d1bd9081951d3509805c035b0c4bcbe79
>> >> It's still not pushed: >> >> $ git fetch && git checkout 7a60910d1bd9081951d3509805c035b0c4bcbe79 >> fatal: reference is not a tree: 7a60910d1bd9081951d3509805c035b0c4bcbe79
> > Embarrassingly, I guess the push failed, and I didn't look carefully. > Now, it definitely is, as > 33e5a354e61aad64afe0e1a4f53773e8547515bf
Yes, the commit is there, and the oneliner above passes now. Thanks & regards, Slaven -- Slaven Rezic - slaven <at> rezic <dot> de Berlin Perl Mongers - http://berlin.pm.org
Date: Sun, 25 Feb 2018 12:47:15 -0700
Subject: Re: [perl #132901] setlocale's return value is broken
To: slaven [...] rezic.de, karl williamson via RT <perlbug-followup [...] perl.org>
From: Karl Williamson <public [...] khwilliamson.com>
Download (untitled) / with headers
text/plain 1.2k
On 02/25/2018 10:21 AM, Slaven Rezic wrote: Show quoted text
> $ env LC_ALL=de_DE.UTF-8 ./perl -Ilib -MTest::More=no_plan -MPOSIX=setlocale,LC_ALL -e 'is setlocale(LC_ALL), "de_DE.UTF-8"' > not ok 1 > # Failed test at -e line 1. > # got: '�^' > # expected: 'de_DE.UTF-8' > 1..1 > # Looks like you failed 1 test of 1.
I realize now in looking at the tests why there is not already a test for this. The reason is that the return from setlocale is explictly documented to be opaque; not necessarily human readable. It is required only that a future setlocale() changing the locale to the value returned properly work. That said, I know of no system that actually doesn't return a human readable name, but it may not exactly match the input one. It might be missing (or gained) a hyphen, or the casing may be different. And where individual categories aren't all the same, LC_ALL is represented differently on different systems. (On Linux, it is a list of the individual categories and their values with each component separated by a semi-colon). I suppose a test could be written which strips off the hyphens and lowercases everything, and then do the comparison, and then we could skip or adjust this test if any platforms showed up if failed for. I'm open to hearing ideas.
RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 1.8k
On Sun, 25 Feb 2018 11:47:40 -0800, public@khwilliamson.com wrote: Show quoted text
> On 02/25/2018 10:21 AM, Slaven Rezic wrote:
> > $ env LC_ALL=de_DE.UTF-8 ./perl -Ilib -MTest::More=no_plan > > -MPOSIX=setlocale,LC_ALL -e 'is setlocale(LC_ALL), "de_DE.UTF-8"' > > not ok 1 > > # Failed test at -e line 1. > > # got: '�^' > > # expected: 'de_DE.UTF-8' > > 1..1 > > # Looks like you failed 1 test of 1.
> > I realize now in looking at the tests why there is not already a test > for this. The reason is that the return from setlocale is explictly > documented to be opaque; not necessarily human readable. It is > required > only that a future setlocale() changing the locale to the value > returned > properly work. > > That said, I know of no system that actually doesn't return a human > readable name, but it may not exactly match the input one. It might > be > missing (or gained) a hyphen, or the casing may be different. And > where > individual categories aren't all the same, LC_ALL is represented > differently on different systems. (On Linux, it is a list of the > individual categories and their values with each component separated > by > a semi-colon). > > I suppose a test could be written which strips off the hyphens and > lowercases everything, and then do the comparison, and then we could > skip or adjust this test if any platforms showed up if failed for. > > I'm open to hearing ideas.
Tests that need constant tweaking are the maintainer’s bane. Could we do some kind of ‘loose match’ that requires at least, say, four or five of the same ASCII alphanumerical characters to be present in both strings, and in the right order? If you transform de_DE.UTF-8 to /d.*e.*d.*e.*/aai this might actually work and require little tweaking in the long term. It would certainly have caught the bug. This would work: $regexp = substr fc($locale) =~ y/a-z0-9//cdr, 0, 4, =~ s/./$&.*/gr; -- Father Chrysostomos
RT-Send-CC: perl5-porters [...] perl.org
OP confirms that is fixed by 33e5a354e61aad64afe0e1a4f53773e8547515bf -- Karl Williamson
Date: Fri, 30 Mar 2018 23:52:29 +0100
From: Zefram <zefram [...] fysh.org>
Subject: Re: [perl #132901] setlocale's return value is broken
To: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 346b
Karl Williamson wrote: Show quoted text
> It is required only that a >future setlocale() changing the locale to the value returned properly work.
That's obviously the correct way to test it: feed the value to setlocale() and check that locale-dependent things behave in accordance with the expected locale. -zefram


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

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org