[Python-modules-team] Bug#749710: python3-networkx: with python3 module, output order is not deterministic
Johannes Schauer
j.schauer at email.de
Thu May 29 11:03:16 UTC 2014
Package: python3-networkx
Version: 1.8.1-1
Severity: normal
Hi,
consider the following graphml file test.xml:
<?xml version="1.0" encoding="UTF-8"?>
<graphml xmlns="http://graphml.graphdrawing.org/xmlns">
<key id="foo" for="node" attr.name="foo" attr.type="string"></key>
<key id="bar" for="node" attr.name="bar" attr.type="string"></key>
<graph id="G">
<node id="0">
<data key="foo">node0foo</data>
<data key="bar">node0bar</data>
</node>
<node id="1">
<data key="foo">node1foo</data>
<data key="bar">node1bar</data>
</node>
<edge id="0" source="0" target="1"></edge>
<edge id="0" source="1" target="0"></edge>
</graph>
</graphml>
Now, read it in with networkx and immediately write it to standard output:
$ python3 -c "import networkx, sys; g = networkx.read_graphml('test.xml'); networkx.write_graphml(g, sys.stdout.buffer)" | md5sum
Expectation: repeated execution of the above leads to the exact same output.
Reality: the output is different every time the above is run, as can be
seen from the different md5sums.
The same can be observed when outputting in dot format instead. So this
problem is not local to the graphml writer.
Interestingly, the problem does not occur with the python2 module. The
following will produce the same output every time it is run:
$ python2 -c "import networkx, sys; g = networkx.read_graphml('test.xml'); networkx.write_graphml(g, sys.stdout)" | md5sum
Thus, I conclude that this is a regression with the python3 verson of
this module.
Please make it such that the python3 module creates deterministic output
just as the python2 module does.
Thanks!
cheers, josch
-- System Information:
Debian Release: jessie/sid
APT prefers testing
APT policy: (990, 'testing'), (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 3.11-2-amd64 (SMP w/4 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 python3-networkx depends on:
pn python3:any <none>
Versions of packages python3-networkx recommends:
pn python3-numpy <none>
ii python3-pkg-resources 3.4.4-1
pn python3-scipy <none>
ii python3-yaml 3.11-1
python3-networkx suggests no packages.
-- debconf-show failed
-- debsums errors found:
sh: 1: /usr/sbin/dpkg-divert: not found
More information about the Python-modules-team
mailing list