Merge lp:~roadmr/checkbox/templates-utf8-encoding into lp:checkbox
Status: | Merged |
---|---|
Merged at revision: | 1446 |
Proposed branch: | lp:~roadmr/checkbox/templates-utf8-encoding |
Merge into: | lp:checkbox |
Diff against target: |
45 lines (+5/-3) 3 files modified
checkbox/lib/template.py (+1/-1) debian/changelog (+3/-1) plugins/message_info.py (+1/-1) |
To merge this branch: | bzr merge lp:~roadmr/checkbox/templates-utf8-encoding |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Marc Tardif (community) | Approve | ||
Review via email: mp+111087@code.launchpad.net |
Description of the change
This fixes the linked bug by explicitly setting the encoding when opening a job/template file.
It would in theory be better to honor the system's encoding, however note that the encoding set in /etc/default/locale is not necessarily the same as that of files that are shipped with a package. Also, since the encoding for the C locale, which is what upstart jobs have, is bogus, assuming UTF-8 in all cases seems safe enough.
Just for kicks, I tried seeing if the system had an invalid encoding set, to fall back to UTF-8 only in that case. But none of the things I tried (locale.
I tested this on a server (where the problem was first observed) by applying these changes manually and then rebooting the server, and there were no errors in the logfile; all jobs were loaded correctly.
Looks perfectly reasonable, thanks for testing this extensively. Merging and building packages.