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

Niko Tyni ntyni at debian.org
Fri Jul 5 12:31:04 BST 2019


On Thu, Jul 04, 2019 at 09:06:33PM +0300, Niko Tyni wrote:
> 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".)

Upstream Karl Williamson thinks this is a bug in glibc but Perl could
use a workaround.

I've filed #931456 on the glibc side and will look at filing it upstream
too.

As for working around it in Perl, the attached first version of a patch
works for me but will need some more work for proper upstreaming.
-- 
Niko
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gettext-caching.diff
Type: text/x-diff
Size: 998 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/perl-maintainers/attachments/20190705/972c65fd/attachment.diff>


More information about the Perl-maintainers mailing list