title: Unable to save kivy widgets to file
body: <p>Try as I might, I an unable to pickle kivy widgets using either pickle or dill. I've already viewed the similar question <a href="https://stackoverflow.com/questions/18693929/saving-a-kivy-widget-to-a-file">here</a>, but the answer given does not seem to work. I've attempted every protocol for both dill and pickle. Attempting this:</p>
  
  <pre><code>from kivy.uix.widget import Widget
  import pickle
  
  widget=Widget()
  pickle.dump(widget,open('example.pkl','wb'),protocol=4)
  </code></pre>
  
  <p>Gives an error like so:</p>
  
  <pre><code>Traceback (most recent call last):
  File "nonsense.py", line 9, in &lt;module&gt;
  pickle.dump(widget,open('test.pkl','wb'),protocol=4)
  _pickle.PicklingError: Can't pickle &lt;class 'weakref'&gt;: attribute lookup weakref on builtins failed
  </code></pre>
  
  <p>Different protocols give different errors. I've attempted to use dill as well (since it can pickle a greater number of types) and I get a different set of errors, depending on the protocol used.</p>
  
  <p>For protocol 0:</p>
  
  <pre><code>TypeError: __init__() takes exactly 0 positional arguments (1 given)
  </code></pre>
  
  <p>for protocol 4:</p>
  
  <pre><code>_pickle.PicklingError: args[0] from __newobj_ex__ args has the wrong class
  </code></pre>
  
  <p>with variations on this theme for the protocols between the two.</p>
  
  <p>Are widgets unable to be pickled in any way? Failing that, is it possible to save a widget to file in some other manner? It would be exceptionally difficult to save the information I need without being able to save any instance of the widget class as well.</p>