title: python pickle gives "AttributeError: 'str' object has no attribute 'write'"
body: <p>When I try to pickle something, I get an <code>AttributeError: 'str' object has no attribute 'write'</code></p>
  
  <p>An example:</p>
  
  <pre><code>import pickle
  pickle.dump({"a dict":True},"a-file.pickle")
  </code></pre>
  
  <p>produces:</p>
  
  <pre><code>...
  AttributeError: 'str' object has no attribute 'write'
  </code></pre>
  
  <p>What's wrong?</p>