Crash report: TypeError: not all arguments converted during string formatting
Cross-platform app for displaying and navigating events on a timeline.
Brought to you by:
rickardlindberg,
rogerlindberg
Reported 16 November 2014:
Traceback (most recent call last): File "timelinelib\wxgui\dialogs\categoryeditor.pyc", line 132, in _btn_ok_on_click File "timelinelib\editors\category.pyc", line 55, in save File "timelinelib\wxgui\dialogs\categoryeditor.pyc", line 88, in handle_invalid_name TypeError: not all arguments converted during string formatting Timeline version: 1.4.1 System version: Windows, nele-notebook, XP, 5.1.2600, x86, x86 Family 6 Model 15 Stepping 13, GenuineIntel Python version: 2.7.6 (default, Nov 10 2013, 19:24:18) [MSC v.1500 32 bit (Intel)] wxPython version: 2.8.12.1 (msw-unicode)
Is this bug still valid? The reported timeline version is 1.4.1.
Is it known how to reproduce this bug or when/where it is happening?
Can't really say. The only info we have is the crash report. I'll have a look at it to see if I can figure anything out.
This error is due to an invalid translation string missing a "%s".
Now we have a test script (Translations.py) that checks all .po files, so that the translated text has the same number of %s as the original text.
I've added this script to the Timeline build routine.
I would like to say that's a double-edged solution. Some languages may need to intentionally omit the %s in some cases, particularly where %s represents a number and language-specific plural rules apply.
Here is an example to make it clearer.
In case where %s == 0:
English: "You have 0 events".
Non-english roughly translated to English: "You have no events".
As you can see, using %s in the non-english example would lead to an unncessary redundancy.
That said, it also depends on what plural rule system you are using in your localization system.
I can see that there might be problems in some cases, but to avoid crash reports we have to assure that there is placeholders for the list of data supplied to the string format function.
As a translator you can't know if %s == 0 or if %s == 99. So the text "no events" is no good as a translation.