Your message dated Sat, 11 Apr 2015 17:07:58 +0100
with message-id 
<CAB4XWXz6xGR8x1+j2dPdATHfbB=j5cd+xdehmmd+3m5_yua...@mail.gmail.com>
and subject line Re: [Python-modules-team] Bug#735776: python-networkx: 
networkx raises TypeError when reading input from .gml file
has caused the Debian Bug report #735776,
regarding python-networkx: networkx raises TypeError when reading input from 
.gml file
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
735776: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=735776
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: python-networkx
Version: 1.7~rc1-3
Severity: normal

Dear Maintainer,

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 <module>
    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

Bug is affecting Debian stable and sid. It seems that version 1.7-2 in
Debian experimental contains the same bug, since it contains the same
line in file gml.py.

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

-- System Information:
Debian Release: 7.3
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-4-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages python-networkx depends on:
ii  python          2.7.3-4+deb7u1
ii  python-support  1.0.15

Versions of packages python-networkx recommends:
ii  python-matplotlib     1.1.1~rc2-1
ii  python-numpy          1:1.6.2-1.2
ii  python-pkg-resources  0.6.24-1
ii  python-pygraphviz     1.1-2
ii  python-scipy          0.10.1+dfsg2-1
ii  python-yaml           3.10-4

python-networkx suggests no packages.

-- no debconf information
graph [
comment "C_3"
     node [ id 1 ]
     node [ id 2 ]
     node [ id 3 ]
     edge[ source 1 target 2 ]
     edge[ source 2 target 3 ]
     edge[ source 3 target 1 ]
]
#!/usr/bin/env python
import networkx as nx
import sys

def cart_product(G, H):
    X = nx.Graph()
    for u in G.nodes():
        for v in H.nodes():
            X.add_node((u,v))
    for u in X.nodes():
        for v in X.nodes():
            if (G.has_edge(u[0], v[0]) and u[1] == v[1]) or \
               (H.has_edge(u[1], v[1]) and u[0] == v[0]):
                X.add_edge(u, v)
    return X


if __name__ == '__main__':
    G = nx.read_gml(sys.argv[1])
    H = nx.read_gml(sys.argv[2])
    X = cart_product(G, H)
    for line in nx.generate_gml(X):
        print line

--- End Message ---
--- Begin Message ---
Version: 1.9+dfsg1-1

On Fri, Jan 17, 2014 at 7:36 PM, Matus Valo <[email protected]> wrote:
> networkx raises TypeError when reading input from .gml file:

This is already fixed.

Regards,
-- 
Sandro Tosi (aka morph, morpheus, matrixhasu)
My website: http://matrixhasu.altervista.org/
Me at Debian: http://wiki.debian.org/SandroTosi

--- End Message ---
_______________________________________________
Python-modules-team mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/python-modules-team

Reply via email to