title: Generic catch for python
body: <p>I have some extremely weird behavior that seems to result in silent exceptions. How can I write a general try catch where I can debug all exceptions. Something along the lines of:</p>
  
  <pre><code>try:
      # something that fails
  except e:
      print e
  </code></pre>
  
  <p>A bit more about the problem at hand in detail:</p>
  
  <p>I have a Django app that on my computer (Ubuntu Linux 8.10) works fine both through runserver and mod-python. On the deploy server (Ubuntu Linux 8.10) it works fine through runserver, but fails via apache in mod-python.</p>
  
  <p>I have reduced the cause down to a part off the app that uses Berkeley DB (bsddb.db), and secondary keys. The callback method for secondary keys uses pickle to format the keys. It fails when I call pickle on a single value. However, it only fails when I use cPickle, and using pickle on the same values outside the callback function also works.</p>
  
  <p>I just want to know why it fails with cPickle.</p>