title: pickle load error "__init__() takes exactly 2 arguments (1 given)"
body: <p>My issue is that a custom class has been saved with pickle.dump, since these files were saved the custom class has been changed and now when I use pickle.load I am getting this error. Is it a problem with the saved file?</p>
  
  <p>The error:</p>
  
  <pre><code>File "/cprprod/extern/lib/python2.7/pickle.py", line 1378, in load
  return Unpickler(file).load()
  File "/cprprod/extern/lib/python2.7/pickle.py", line 858, in load
  dispatch[key](self)
  file "/cprprod/extern/lib/python2.7/pickle.py", line 1070, in load_inst
  self._instantiate(klass, self.marker())
  File "/cprprod/extern/lib/python2.7/pickle.py", line 1060, in _instantiate
  value = klass(*args)
  </code></pre>
  
  <p>Is there anything I can do to load the file?</p>
  
  <p>The code </p>
  
  <pre><code>file = open(filename,'rb')
  obj = pickle.load(file)
  </code></pre>
  
  <p>will give me the error. </p>
  
  <hr>
  
  <p>Here is some minimal code which can reproduce the error:</p>
  
  <pre><code>import pickle
  
  class foo:
      def __init__(self,a):
          self.a = a
  
      def __str__(self):
          return str(self.a)
  
  obj = foo(1)
  
  with open('junk','wb') as f:
      pickle.dump(obj,f)
  
  class foo:
      def __init__(self,a,b):
          self.a = a
          self.b = b
      def __str__(self):
          return '%s %s'%(self.a,self.b)
  
      def __getinitargs__(self):
          return (self.a,self.b)
  
  with open('junk','rb') as f:
      obj = pickle.load(f)
      print str(obj)
  </code></pre>