Message149420
string.Formatter doesn't support empty curly braces "{}" unlike str.format .
>>> import string
>>> a = string.Formatter()
>>> a.format("{}","test")
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
a.format("{}","hello")
File "/usr/lib/python3.2/string.py", line 180, in format
return self.vformat(format_string, args, kwargs)
File "/usr/lib/python3.2/string.py", line 184, in vformat
result = self._vformat(format_string, args, kwargs, used_args, 2)
File "/usr/lib/python3.2/string.py", line 206, in _vformat
obj, arg_used = self.get_field(field_name, args, kwargs)
File "/usr/lib/python3.2/string.py", line 267, in get_field
obj = self.get_value(first, args, kwargs)
File "/usr/lib/python3.2/string.py", line 226, in get_value
return kwargs[key]
KeyError: '' |
|
Date |
User |
Action |
Args |
2011-12-14 03:59:22 | Ramchandra Apte | set | recipients:
+ Ramchandra Apte |
2011-12-14 03:59:22 | Ramchandra Apte | set | messageid: <1323835162.4.0.792542335688.issue13598@psf.upfronthosting.co.za> |
2011-12-14 03:59:21 | Ramchandra Apte | link | issue13598 messages |
2011-12-14 03:59:21 | Ramchandra Apte | create | |
|