"%" needs to be escaped or a exception is raised (when no args are to be replaced)

Bug #501911 reported by Rodrigo Bistolfi
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
lalita
Fix Released
Medium
Unassigned

Bug Description

If a message from a plug-in contains "%", an exception is raised:

{{{
 File "/home/rbistolfi/lalita/core/dispatcher.py", line 198, in get_translation
     finalmsg = trans % args
 TypeError: not enough arguments for format string
}}}

"%" should be escaped from messages for preventing this exception (replacing "%" with "%%" before using say() works for me.)

Revision history for this message
Facundo Batista (facundo) wrote :

If you call .say() with "%" and without args, it should work without escaping the "%" (as there're no args, no replacement should be done).

summary: - "%" needs to be escaped or a exception is raised
+ "%" needs to be escaped or a exception is raised (when no args are to be
+ replaced)
Changed in lalita:
status: New → Confirmed
importance: Undecided → Medium
milestone: none → alpha
Changed in lalita:
status: Confirmed → Fix Committed
Changed in lalita:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.