networkx/networkx — pull request #1048 by chebee7i (2014-01-18 17:32:29+00:00)
Title: networkx raises TypeError when reading input from .gml file

Hello,
I'm reporting the Debian bug #735776 :

```
networkx raises TypeError when reading input from .gml file:

$ python cart_product.py c3.gml c3.gml
graph [
node [
id 0
Traceback (most recent call last):
File "cart_product.py", line 22, in
for line in nx.generate_gml(X):
File "/usr/lib/pymodules/python2.7/networkx/readwrite/gml.py", line 328, in generate_gml
yield 2*indent+'label %s'%label
TypeError: not all arguments converted during string formatting

[8<]

It seems that bug is fixed by applying the following patch (tested for
debian stable and sid):

--- a/networkx/readwrite/gml.py
+++ b/networkx/readwrite/gml.py
@@ -325,7 +325,7 @@
label=G.node[n].get('label',n)
if is_string_like(label):
label='"%s"'%label
- yield 2*indent+'label %s'%label
+ yield 2*indent+'label {0}'.format(label)
if n in G:
for k,v in G.node[n].items():
if k=='id' or k == 'label': continue
```