Bug#931139: perl: switching locales no longer invalidates gettext translation cache

Niko Tyni ntyni at debian.org
Thu Jul 4 19:06:33 BST 2019


Control: forwarded -1 https://rt.perl.org/Public/Bug/Display.html?id=134264

On Thu, Jul 04, 2019 at 08:04:52PM +0300, Niko Tyni wrote:

> > Starting with Perl 5.28, Perl uses POSIX 2008 thread-safe locales, so
> > it calls uselocale(3) underneath when the Perl side POSIX::setlocale()
> > function is invoked.
> > 
> > This makes gettext think that a translation for the new locale is already
> > loaded when it really corresponds to the old locale.
> > 
> > While this is a 5.28 regression for Perl, it's not clear to me
> > whether glibc is working correctly here or not.

This is now reported upstream as [perl #134264].

I'm attaching an updated test case in C, which just sets LANG at startup
(as glibc won't look at LANGUAGE if the locale is totally unset / set to
"C".)

I'm also attaching a minimal Perl test case using Locale::gettext that
demonstrates the 5.26 / 5.28 difference.
-- 
Niko
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 931139.c
Type: text/x-csrc
Size: 882 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/perl-maintainers/attachments/20190704/48682da4/attachment.c>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 931139.pl
Type: text/x-perl
Size: 389 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/perl-maintainers/attachments/20190704/48682da4/attachment.pl>


More information about the Perl-maintainers mailing list