python exception message formating
<p>Why don't I get an exception message when formating the message with <code>%s</code> but I do with <code>format</code>?</p>

<p>Fails:</p>

<pre><code>&gt;&gt;&gt; Exception('foo %s', 'bar').message
''
</code></pre>

<p>Works:</p>

<pre><code>&gt;&gt;&gt; Exception('foo {}'.format('bar')).message
'foo bar'
</code></pre>

<p>Any explanation why it fails on <code>%s</code>?</p>

<p>Your syntax for the %-substitution in <code>Exception</code> is incorrect. You need to use <code>%</code> to specify the replacement string:</p>

<pre><code>&gt;&gt;&gt; Exception('foo %s' % 'bar').message
'foo bar'
</code></pre>

python exception