Merge lp://staging/~mvo/ubuntu-release-upgrader/use-str.format into lp://staging/ubuntu-release-upgrader
Proposed by
Michael Vogt
Status: | Rejected |
---|---|
Rejected by: | Michael Vogt |
Proposed branch: | lp://staging/~mvo/ubuntu-release-upgrader/use-str.format |
Merge into: | lp://staging/ubuntu-release-upgrader |
Diff against target: |
888 lines (+175/-142) 14 files modified
DistUpgrade/DistUpgradeAptCdrom.py (+1/-1) DistUpgrade/DistUpgradeCache.py (+10/-10) DistUpgrade/DistUpgradeController.py (+39/-38) DistUpgrade/DistUpgradeFetcherCore.py (+5/-5) DistUpgrade/DistUpgradeFetcherKDE.py (+4/-3) DistUpgrade/DistUpgradeGettext.py (+7/-2) DistUpgrade/DistUpgradeView.py (+27/-24) DistUpgrade/DistUpgradeViewGtk3.py (+25/-21) DistUpgrade/DistUpgradeViewKDE.py (+23/-15) DistUpgrade/DistUpgradeViewText.py (+10/-5) DistUpgrade/GtkProgress.py (+8/-8) check-new-release-gtk (+8/-7) do-partial-upgrade (+3/-3) pre-build.sh (+5/-0) |
To merge this branch: | bzr merge lp://staging/~mvo/ubuntu-release-upgrader/use-str.format |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ubuntu Core Development Team | Pending | ||
Review via email: mp+217004@code.staging.launchpad.net |
Description of the change
Use str.format() with gettext (eventually everywhere) to avoid crashes if e.g. incorrect translations are specified. The worst case with str.format() is that the information is not displayed correctly, but it won't crash like e.g. LP: #1311396
To post a comment you must log in.
Unmerged revisions
- 2779. By Michael Vogt
-
replace all %s style format with str.format() in gettext to be more robust against crashes from incorrectly formated translations
- 2778. By Michael Vogt
-
use str.format() for all ngettext() to avoid crashes on incorrect number of parameters (LP: #1311396
Maybe str.format is better for other reasons, but you can certainly still get tracebacks from it:
$ python3 -c "'hello {0'.format( 'world' )"
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: expected '}' before end of string