title: Cannot unpickle Exception subclass
body: <p>Simplified version of <a href="https://stackoverflow.com/questions/41770024/why-is-my-custom-exception-unpickle-failing">Why is my custom exception unpickle failing</a>.</p>
  
  <p>I am trying to pickle a 'simple' exception subclass. It pickles OK, but when unpickling it falls over:</p>
  
  <pre><code>import pickle
  
  class ABError(Exception):
      def __init__(self, a, b):
          self.a = a
          self.b = b
  
  ab_err = ABError("aaaa", "bbbb")
  
  pickled = pickle.dumps(ab_err)
  original = pickle.loads(pickled)  # Fails
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>Traceback (most recent call last):
    File "p.py", line 12, in &lt;module&gt;
      original = pickle.loads(pickled)  # Fails
    File "/usr/lib/python2.7/pickle.py", line 1388, in loads
      return Unpickler(file).load()
    File "/usr/lib/python2.7/pickle.py", line 864, in load
      dispatch[key](self)
    File "/usr/lib/python2.7/pickle.py", line 1139, in load_reduce
      value = func(*args)
  TypeError: __init__() takes exactly 3 arguments (1 given)
  </code></pre>
  
  <p>An earlier comment suggested the issue is because the built in <code>Exception</code> class supplies a <code>__setstate_()</code> method. However, it's not clear to me if this is expected behaviour or not - it certainly seems surprising since doing the same thing with a subclass of <code>object</code> works OK.</p>