title: Networkx edge not adding attributes correctly
body: <p>I've pulled up some code I used to play with in 1.6.1 of networkx. On 1.8.1 it doesn't work when writing to <code>gml</code> or <code>graphml</code>. </p>
  
  <p>The problem boils down to being unable to write edge attributes inside the data dict like so:</p>
  
  <pre><code>BasicGraph = nx.read_graphml("KeggCompleteEng.graphml")
  
  for e,v in BasicGraph.edges_iter():
      BasicGraph[e][v]['test'] = 'test'
  
  nx.write_graphml(BasicGraph, "edgeTester.graphml")
  </code></pre>
  
  <p>Causes the error:</p>
  
  <pre><code>AttributeError: 'str' object has no attribute 'items'
  </code></pre>
  
  <p>When I use: <code>for e,v,data in BasicGraph.edges_iter(data=True):</code> the data prints out like so:</p>
  
  <pre><code>{'root_index': -3233, 'label': u'unspecified'}
  test
  </code></pre>
  
  <p>AKA the new attribute is outside the dictionary.</p>
  
  <p>The documentation says I should be able to do it like above. However, I imagine I've made a silly mistake and would appreciate being put back on the right path!</p>
  
  <p>EDIT:</p>
  
  <p>So I ran the program with a graph generated inside the program:  <code>BasicGraph = nx.complete_graph(100)</code> and it ran fine. </p>
  
  <p>I then ran it with an example graphml file from the primer: <code>BasicGraph = nx.read_graphml("graphmltest.graphml")</code> and that too worked. (I even imported into and out of Cytoscape to check that wasn't the issue)</p>
  
  <p>So obviously it's the file I'm using. <a href="https://www.dropbox.com/s/bohcohpz8kxbk7t/KeggCompleteEng.graphml" rel="nofollow">Here's</a> a link to it, can anyone see what's wrong with it?</p>