On 12.07.17 02:55, Daniel Kahn Gillmor wrote:
> Control: severity 867542 normal
>
> Hi Jörg--
>
> Over in https://bugs.debian.org/867542, you wrote:
>
>> decryption of messages in thunderbird fails.
>
> how does it fail? does it hang? show you an error message?
>
>> The log of enigmail shows this:
>>
>> --- %< ---
>> 2017-07-07 08:34:46.501 [DEBUG] errorHandling.jsm: parseErrorOutputWith:
>> statusFlags = 0020
>> 2017-07-07 08:34:46.501 [DEBUG] errorHandling.jsm: parseErrorOutputWith:
>> return
>> with c.errorMsg =
>> 2017-07-07 08:34:46.501 [DEBUG] execution.jsm: EnigmailExecution.fixExitCode:
>> agentType: gpg exitCode: 0 statusFlags undefined
>> 2017-07-07 08:34:46.502 [CONSOLE]
>> 2017-07-07 08:34:46.502 [DEBUG] keyRing.jsm: createAndSortKeyList()
>> 2017-07-07 08:34:46.504 [ERROR] enigmailMessengerOverlay.js:
>> messageDecryptCb:
>> caught exception: RangeError
>> Message: 'invalid language tag: en-US.UTF-8'
>> File:resource://enigmail/time.jsm
>> Line:48
>> Stack: EnigmailTime.getDateTime@resource://enigmail/time.jsm:48:14
>> KeyObject@resource://enigmail/keyRing.jsm:1607:19
>> appendKeyItems@resource://enigmail/keyRing.jsm:1436:20
>> createKeyObjects@resource://enigmail/keyRing.jsm:1411:3
>> createAndSortKeyList@resource://enigmail/keyRing.jsm:1560:3
>> loadKeyList@resource://enigmail/keyRing.jsm:1283:3
>> EnigmailKeyRing.getAllKeys@resource://enigmail/keyRing.jsm:151:7
>> EnigmailKeyRing.getKeyById@resource://enigmail/keyRing.jsm:222:7
>> EnigmailDecryption.decryptMessageEnd@resource://enigmail/decryption.jsm:348:26
>> EnigmailDecryption.decryptMessage@resource://enigmail/decryption.jsm:553:20
>> Enigmail.msg.messageParseCallback@chrome://enigmail/content/enigmailMessengerOverlay.js:1005:19
>> Enigmail.msg.messageParse@chrome://enigmail/content/enigmailMessengerOverlay.js:926:5
>> Enigmail.msg.messageDecryptCb@chrome://enigmail/content/enigmailMessengerOverlay.js:764:9
>> _f@chrome://enigmail/content/enigmailMessengerOverlay.js:555:9
>> callbackWrapper@resource://enigmail/timer.jsm:38:9
>> --- >% ---
>
> thanks for the logs. Was it repeatable reliably with 1.9.8-1 ? Are you
> able to get this to repeat with 1.9.8.1-1 (the version i uploaded to
> unstable today)?
>
>> Something seems odd with the language tag "en-US.UTF-8".
>>
>> The command "locale -a" shows on this system among others "en_US.utf8".
>
> I am used to seeing en_US.UTF-8 for LANG, but not en-US.UTF-8. Are you
> setting NSILOCALE_TIME anywhere in your environment?
>
>> For the moment I will revert back to the last working version 2:1.9.7-2.
>
> The line you're getting an error on was definitely changed between 1.9.7
> and 1.9.8 (it was changed in 30c1fe69a7c62007f925d760efc832884aed4412,
> which overhauls the time calculations).
>
> Maybe upstream (cc'ed here) can shed some light on this?
We had to change this for Thunderbird 52 due to the following Mozilla
bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1367672
The correct locale format in Thunderbird is xx-yy (not xx_yy). However,
Thunderbird seems to be unable to cope with additional parameters in the
locale like ".UTF-8".
I would expect that the following patch fixes the issue.
-Patrick
--- a/package/time.jsm
+++ b/package/time.jsm
@@ -52,7 +52,10 @@ const EnigmailTime = {
options.minute = DATE_2DIGIT;
}
- return new
Intl.DateTimeFormat(appLocale.getCategory("NSILOCALE_TIME"),
options).format(dat);
+ let useLocale = appLocale.getCategory("NSILOCALE_TIME").substr(0, 5);
+ useLocale = useLocale.replace(/_/g, "-");
+
+ return new Intl.DateTimeFormat(useLocale, options).format(dat);
}
else {
return "";