python-igraph Raise ValueError: iterable must yield numbers when I used write_gml

I often raise a ValueError for function write_gml, after I add some new vertices in constructed graph object. However, It works when I replace it for write_graphml. What can I do for solving this problem.

Can you show a complete minimal example that illustrates the problem? See http://sscce.org/ for guidance.

Thanks for your reply. The minimal example following:

import igraph
g = ssn.subgraph(cc) # ssn is a already constructed graph, cc represents ssn's component. 
nodes = g.vs.select(_degree_eq=1, genesNum_gt=1) # genesNum: a node attribution
for node in nodes:
      names = node['name'].split(' ')
      for name in names:
           g.add_vertex(name,name=name)
           g.add_edge(name,node)
g.write_gml(fileName)
raise ValueError: iterable must yield numbers

Can you please show a complete (but still minimal) example? This one relies on data that only you have.