Merge lp:~mvo/aptdaemon/lp1058038 into lp:aptdaemon

Proposed by Michael Vogt
Status: Needs review
Proposed branch: lp:~mvo/aptdaemon/lp1058038
Merge into: lp:aptdaemon
Diff against target: 22 lines (+9/-0)
1 file modified
aptd (+9/-0)
To merge this branch: bzr merge lp:~mvo/aptdaemon/lp1058038
Reviewer Review Type Date Requested Status
Aptdaemon Developers Pending
Review via email: mp+128470@code.launchpad.net

Description of the change

Workaround for that ensures that the sys.getfilesystemencoding() is valid
when auto-activated without LANG/LANGUAGE environment

To post a comment you must log in.
Revision history for this message
Michael Vogt (mvo) wrote :

To test:
$ mkdir /tmp/äää
$ (cd /tmp/äää ; apt-get download 2vcard)
$ aptdcon --install /tmp/äää/2vcard*.deb

this will crash with the default aptd and work once the new one is installed/restarted.

Unmerged revisions

863. By Michael Vogt

re-exec if there is no LANG set to force C.UTF-8 in this case to have a utf8 sys.getfilesystemencoding() instead of a ascii one, see LP: #1058038

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'aptd'
2--- aptd 2012-05-11 16:21:16 +0000
3+++ aptd 2012-10-08 11:37:49 +0000
4@@ -22,9 +22,18 @@
5 __author__ = "Sebastian Heinlein <devel@glatzor.de>"
6 __state__ = "experimental"
7
8+import os
9+import sys
10+
11 import aptdaemon.core
12
13 if __name__ == "__main__":
14+ # workaround bug LP: #1058038 by ensuring that the default fs encoding is
15+ # set
16+ if (sys.getfilesystemencoding() == "ascii" and
17+ not "LANG" in os.environ):
18+ os.environ["LANG"] = "C.UTF-8"
19+ os.execv(sys.argv[0], sys.argv)
20 aptdaemon.core.main()
21
22 # vim:ts=4:sw=4:et

Subscribers

People subscribed via source and target branches

to status/vote changes: