Glad if I can help :-)

My unattended-upgrades is version 0.86.3. It updated today from version 0.86.2. I do have

    from gettext import lgettext as _

(at line 44).

The output of locale is:

# locale
LANG=de_DE.UTF-8
LANGUAGE=
LC_CTYPE="de_DE.UTF-8"
LC_NUMERIC="de_DE.UTF-8"
LC_TIME="de_DE.UTF-8"
LC_COLLATE="de_DE.UTF-8"
LC_MONETARY="de_DE.UTF-8"
LC_MESSAGES="de_DE.UTF-8"
LC_PAPER="de_DE.UTF-8"
LC_NAME="de_DE.UTF-8"
LC_ADDRESS="de_DE.UTF-8"
LC_TELEPHONE="de_DE.UTF-8"
LC_MEASUREMENT="de_DE.UTF-8"
LC_IDENTIFICATION="de_DE.UTF-8"
LC_ALL=
Currently it doesn't crash because I just manually updated all my packages (apt-get update, apt-get upgrade). Guess I will have to wait with generating more debug info until some package updates are available in the repos.

Let me know what you want me to try out next.

Frank

------ Originalnachricht ------
Von: "Michael Vogt" <m...@debian.org>
An: mrpa...@gmail.com; 793...@bugs.debian.org
Gesendet: 8/31/2015 19:28:23
Betreff: Re: Bug#793663: [unattended-upgrades] Unsupported operand type(s) for %: 'bytes' and 'tuple'

On Mon, Aug 31, 2015 at 11:48:42AM +0000, mrpa...@gmail.com wrote:
 Hi Michael,
Hi Frank,

Thanks for looking into the issue. I'm getting almost the exact same error message. It started a few weeks ago. The issue is reproducible whether I run
 unattended-upgrades from the shell or from cron.

Thanks a lot for helping me to track down this issue! Great to have
someone who can reproduce the issue, I really want to track down this
issue so its awsome to have you to help and answer all my questions :)

File "/usr/bin/unattended-upgrade", line 815, in send_summary_mail
         host(), res)
     TypeError: unsupported operand type(s) for %: 'bytes' and 'tuple'
 This statement is causing the error on my system:

subject = _("unattended-upgrades result for '%s': '%s'") % (host(), res)

res argument is 'None'. host() is a string. type(_("unattended-upgrades
 result for '%s': '%s'")) is <class 'bytes'>. Shouldn't this be
         string?

This smeels like a clue:
  type(_("unattended-upgrades result for '%s': '%s'")
should indeed be "str" instead of bytes.

What version of unattended-upgrades do you have?
$ apt list unattended-upgrades
will tell you.

Do you have in the unattended-upgrades binary the lines:
"""
from gettext import lgettext as _
"""

 My
locale is de_DE.UTF-8. gettext on the shell does return a translation:

# gettext unattended-upgrades "unattended-upgrades result for '%s':
 '%s'"
     Unattended-Upgrades-Ergebnis für »%s«: %s

If I change the message to be translated, unattended-upgrades continues, but
 complains about another _(...) message further down.

 Now I'm lost. Any help is greatly appreciated.

What is the output of "locale"?



Thanks,
 Michael

Reply via email to