title: Python: saving objects and using pickle. Error using pickle.dump
body: <p>Hello I have an Error and I don´t the reason:</p>
  
  <pre><code>&gt;&gt;&gt; class Fruits:pass
  ...
  &gt;&gt;&gt; banana = Fruits()
  &gt;&gt;&gt; banana.color = 'yellow'
  &gt;&gt;&gt; banana.value = 30
  &gt;&gt;&gt; import pickle
  &gt;&gt;&gt; filehandler = open("Fruits.obj",'w')
  &gt;&gt;&gt; pickle.dump(banana,filehandler)
  Traceback (most recent call last):
  File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  File "C:\Python31\lib\pickle.py", line 1354, in dump
  Pickler(file, protocol, fix_imports=fix_imports).dump(obj)
  TypeError: must be str, not bytes
  &gt;&gt;&gt;
  </code></pre>
  
  <p>I don´t know how to solve this error because I don´t understand it.
  Thank you so much.</p>