Eric V. Smith added the comment:
This is because Exception does not define __format__, so object.__format__ is
being called. object.__format__ does not allow any format specifier to be used.
You get the same error for any object without its own __format__, when you
supply a format spec.
>>>
New submission from Johannes Raggam :
The following is valid Python 2:
>>> 'okay {0:s}'.format(Exception('test'))
'okay test'
>>> 'okay {0}'.format(Exception('test'))
'okay test'
The following fails on Python 3.6:
>>> 'okay {0:s}'.format(Exception('test'))
Traceback (most recent call last):