Issue #11 resolved

graphreport doesn't work with Python 3

Andrew Barnert
created an issue

I've never used modulegraph anywhere but within py2app, so I only know how to test it via py2app.

But "python3 setup.py py2app --graph" on any trivial project will fail with this:

creating dependency graph: jsonrpcbroker.dot Traceback (most recent call last): File "setup.py", line 18, in <module> setup_requires=['py2app'], File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/distutils/core.py", line 148, in setup dist.run_commands() File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/distutils/dist.py", line 917, in run_commands self.run_command(cmd) File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/distutils/dist.py", line 936, in run_command cmd_obj.run() File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/py2app/build_app.py", line 510, in run self._run() File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/py2app/build_app.py", line 698, in _run self.run_normal() File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/py2app/build_app.py", line 782, in run_normal self.build_graph(mf, flatpackages) File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/py2app/build_app.py", line 738, in build_graph mf.graphreport(fp, flatpackages=flatpackages) File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/modulegraph/modulegraph.py", line 1313, in graphreport fileobj.writelines(self.itergraphreport(flatpackages=flatpackages)) File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/modulegraph/modulegraph.py", line 1218, in itergraphreport for item in attr.iteritems(): AttributeError: 'dict' object has no attribute 'iteritems'

Comments (3)

  1. Andrew Barnert reporter

    It looks like build_xref has similar problems; doing --xref on the py2app call throws because it's using Py2 urllib. The end of the traceback looks like this:

    File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/py2app/build_app.py", line 784, in run_normal self.build_xref(mf, flatpackages) File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/py2app/build_app.py", line 727, in build_xref mf.create_xref(fp) File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/modulegraph/modulegraph.py", line 1164, in create_xref url = urllib.pathname2url(m.filename or "") AttributeError: 'module' object has no attribute 'pathname2url'

  2. Ronald Oussoren repo owner

    Test coverage of modulegraph is even worse than I expected. Sigh...

    Fixing this should be fairly easy, I should have some time to look into this tonight.

  3. Log in to comment