Subject: bug#24192: Gajim fails with locale.Error

From: Alex Kost <[email-masked]>
Date: Tue, 09 Aug 2016 23:53:29 +0300

Cc-ing David Thompson (the author of haunt).

Daniel Pimentel (2016-08-09 20:28 +0300) wrote:

> I have a similar problem with locale in Haunt package:
>
> Backtrace:
> In ice-9/boot-9.scm:
>  157: 10 [catch #t #<catch-closure 11f0b40> ...]
> In unknown file:
>    ?: 9 [apply-smob/1 #<catch-closure 11f0b40>]
> In ice-9/boot-9.scm:
>   63: 8 [call-with-prompt prompt0 ...]
> In ice-9/eval.scm:
>  432: 7 [eval # #]
> In ice-9/boot-9.scm:
> 2401: 6 [save-module-excursion #<procedure 120e940 at
> ice-9/boot-9.scm:4045:3 ()>]
> 4050: 5 [#<procedure 120e940 at ice-9/boot-9.scm:4045:3 ()>]
> 1724: 4 [%start-stack load-stack ...]
> 1729: 3 [#<procedure 1224ea0 ()>]
> In unknown file:
>    ?: 2 [primitive-load
> "/gnu/store/v6gq48wbxprf3sbrxdkc9scb80nyypjs-haunt-0.2/bin/.haunt-real"]
> In haunt/ui.scm:
>  130: 1 [haunt-main
> "/gnu/store/v6gq48wbxprf3sbrxdkc9scb80nyypjs-haunt-0.2/bin/.haunt-real"
> ...]
> In unknown file:
>    ?: 0 [setlocale 6 ""]
>
> ERROR: In procedure setlocale:
> ERROR: In procedure setlocale: Invalid argument

I don't have this problem when GUIX_LOCPATH is set properly (on GuixSD
it is "/run/current-system/locale").

Hi David, I think it would be good if haunt just displayed a warning
instead of failing like this, so instead of calling 'setlocale' directly
in 'haunt-main', you can catch a potential error as it is done in Guix:
look at 'install-locale' procedure in (guix ui) module.

-- 
Alex