Attachments you submit will be routed for moderation. If you have an account, please
log in first.
Ticket #2491: 0001-Workaround-to-Python-2.7-regression-in-locale.format.patch
|
File 0001-Workaround-to-Python-2.7-regression-in-locale.format.patch, 1.1 KB
(added by walter, 2 years ago)
|
|
using format_string()
|
-
From c0885c5fe55dca2d9fb4df32b7a4e9bae95a301b Mon Sep 17 00:00:00 2001
From: Walter Bender <walter@sugarlabs.org>
Date: Fri, 26 Nov 2010 10:35:56 -0500
Subject: [PATCH] Workaround to Python 2.7 regression in locale.format(): it disallows trailing text after the format specifier.
---
extensions/cpsection/updater/view.py | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/extensions/cpsection/updater/view.py b/extensions/cpsection/updater/view.py
index de50d8d..814658f 100644
|
a
|
b
|
|
| 385 | 385 | return _('1 KB') |
| 386 | 386 | elif size < 1024 * 1024: |
| 387 | 387 | # TRANS: download size of small updates, e.g. '250 KB' |
| 388 | | return locale.format(_('%.0f KB'), size / 1024.0) |
| | 388 | return locale.format_string(_('%.0f KB'), size / 1024.0) |
| 389 | 389 | else: |
| 390 | 390 | # TRANS: download size of updates, e.g. '2.3 MB' |
| 391 | | return locale.format(_('%.1f MB'), size / 1024.0 / 1024) |
| | 391 | return locale.format_string(_('%.1f MB'), size / 1024.0 / 1024) |
Download in other formats: