title: UnicodeDecodeError for writing file
body: <p>I know that this is a very common error, but it's the first time I've encountered it when trying to write a file.</p>
  
  <p>I'm using <code>networkx</code> to work with graphs for network analysis, and when I try to write into any format:</p>
  
  <pre><code>nx.write_gml(G, "Graph.gml")
  nx.write_pajek(G, "Graph.net")
  nx.write_gexf(G, "graph.gexf")
  </code></pre>
  
  <p>I get:</p>
  
  <pre class="lang-none prettyprint-override"><code>Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
    File "&lt;string&gt;", line 2, in write_pajek
    File "/Library/Python/2.7/site-packages/networkx/utils/decorators.py", line 263, in _open_file
      result = func(*new_args, **kwargs)
    File "/Library/Python/2.7/site-packages/networkx/readwrite/pajek.py", line 100, in write_pajek
      path.write(line.encode(encoding))
  UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 19: ordinal not in range(128)
  </code></pre>
  
  <p>I haven't found documentation on this, so quite confused.</p>