google-code-export / endgame-singularity

Automatically exported from code.google.com/p/endgame-singularity
1 stars 0 forks source link

Bad cal into locale.format results in exception when displaying base detection chances #123

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Xubuntu, Natty
Singularity version: 0.30c, english loc

1. finished the required Socioanalytics research
2. failure: attempt to "Open base"/"New base" results in the menu dialog being 
displayed.

Doing the above with the game launched from a terminal, results in the 
exception below (skipping the bottom of the stack, keeping only the most recent 
calls).

"...
  File "/usr/share/games/singularity/code/screens/base.py", line 345, in rebuild
    (get_chance("news"), get_chance("science"),
  File "/usr/share/games/singularity/code/screens/base.py", line 343, in get_chance
    return g.to_percent(chance.get(group, 0))
  File "/usr/share/games/singularity/code/g.py", line 270, in to_percent
    return locale.format("%d%%", raw_percent // 100).decode(encoding)
  File "/usr/lib/python2.7/locale.py", line 189, in format
    "format specifier, %s not valid") % repr(percent))
ValueError: format() must be given exactly one %char format specifier, '%d%%' 
not valid
"

Original issue reported on code.google.com by acolomit...@gmail.com on 3 Jul 2011 at 9:57

GoogleCodeExporter commented 9 years ago
Fixed in 0.30c.

Original comment by phil.bor...@gmail.com on 29 Mar 2012 at 7:06