Merge lp:~jtv/launchpad/bug-533668 into lp:launchpad
| Status: | Merged | ||||
|---|---|---|---|---|---|
| Approved by: | Aaron Bentley on 2010-03-08 | ||||
| Approved revision: | no longer in the source branch. | ||||
| Merged at revision: | not available | ||||
| Proposed branch: | lp:~jtv/launchpad/bug-533668 | ||||
| Merge into: | lp:launchpad | ||||
| Diff against target: |
101 lines (+30/-9) 3 files modified
lib/lp/translations/doc/translations-export-to-branch.txt (+4/-3) lib/lp/translations/scripts/tests/test_translations_to_branch.py (+24/-1) lib/lp/translations/scripts/translations_to_branch.py (+2/-5) |
||||
| To merge this branch: | bzr merge lp:~jtv/launchpad/bug-533668 | ||||
| Related bugs: |
|
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Aaron Bentley (community) | Approve on 2010-03-08 | ||
| Canonical Launchpad Engineering | code | 2010-03-08 | Pending |
|
Review via email:
|
|||
Commit Message
Hande non-ascii exceptions in translations-to-bzr exports.
Description of the Change
== Bug 533668 ==
When a project name has non-ascii characters, and translations export to a branch fails for that project, the attempt to log an error message breaks. This happened with µBlogger the other day.
Actually, even before we get to logging a message, it's the attempt to produce a sensible error message out of the exception that breaks.
So this branch replaces the logic with a built-in one: Exception.__repr__. In the duck-typing tradition, this takes the question of str-vs-unicode out of our code and also does the right thing with exceptions without messages, as well as extra arguments describing the exception.
To test:
{{{
./bin/test -vv -t exportToBranche
}}}
No lint.
To Q/A, have this run on the staging codehosting server, against the staging db. The export for µBlogger should fail and produce a sensible error message, after which the script should recover and continue to run rather than bail out.
Jeroen

As discussed on IRC, please use repr(e) rather than e.__repr__(). Aside from that, looks good.