Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • graph-tool graph-tool
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 47
    • Issues 47
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar

Please use the issue tracker only to report bugs (i.e. errors in the library that need to be fixed) or feature requests.

For questions about how to compile, install or use the library, please use instead the mailing list at https://graph-tool.skewed.de/mailing
(If unsure, use the mailing list first.)



When opening new issues, please choose the BUG template from the drop-down menu, and fill out the required information.

  • Tiago Peixoto
  • graph-toolgraph-tool
  • Issues
  • #681
Closed
Open
Created Sep 24, 2020 by S Egbert@egberts2 of 5 tasks completed2/5 tasks

graph_tool.load: RuntimeError: Wanted "graph" or "digraph" (token is "<eof> ''")

Bug reports:

Attempting to open a '.dot' file resulted in a strange error:

$ python3.7  /tmp/graph_load.py 
Traceback (most recent call last):
  File "/tmp/graph_load.py", line 5, in <module>
    g.load("/tmp/x.dot", 'dot')
  File "/usr/lib/python3/dist-packages/graph_tool/__init__.py", line 2889, in load
    ignore_ep, ignore_gp)
RuntimeError: Wanted "graph" or "digraph" (token is "<eof> ''")
$ 

Source code graph_load.py contains 6 lines:

#!/usr/bin/python3
from graph_tool.all import *

g = Graph()
g.load("/tmp/x.dot", 'dot')

Example '/tmp/x.dot' is a dot digraph, is attached to this issue but below are the first few lines:

// Generated by GNU Bison 3.3.2.
// Report bugs to <bug-bison@gnu.org>.
// Home page: <http://www.gnu.org/software/bison/>.

digraph "parser_bison.ypp"
{
  rankdir=LR;
  node [fontname = courier, shape = box, colorscheme = paired6]
  edge [fontname = courier]

  0 [label="State 0\n\l  0 $accept: . input \"end of file\"\l"]
  0 -> 1 [style=dashed label="input"]
  0 -> "0R1" [style=solid]
 "0R1" [label="R1", fillcolor=3, shape=diamond, style=filled]
  1 [label="State 1\n\l  0 $accept: input . \"end of file\"\l  2 input: input . 
line\l"]
  1 -> 2 [style=solid label="\"end of file\""]
  1 -> 3 [style=dotted]
  1 -> 4 [style=solid label="\"newline\""]
  1 -> 5 [style=solid label="\"semicolon\""]
  1 -> 6 [style=solid label="\"include\""]
  1 -> 7 [style=solid label="\"define\""]
  1 -> 8 [style=solid label="\"redefine\""][x.dot](/uploads/9dfbd88f70e3cd57096012f404888712/x.dot)

...

}

On Debian buster package 2.35 (commit a06d49a6, Wed Sep 16 18:34:19 2020 +0200) on Debian 10 (Buster).

OS uname -a:

Linux 4.19.0-10-amd64 #1 SMP Debian 4.19.132-1 (2020-07-24) x86_64 GNU/Linux

Debian package used:

$ apt show -a python3-graph-tool
Package: python3-graph-tool
Version: 2.35
Priority: extra
Section: python
Maintainer: Tiago de Paula Peixoto <tiago@skewed.de>
Installed-Size: 318 MB
Depends: libboost-context1.67.0, libboost-coroutine1.67.0, libboost-iostreams1.67.0, libboost-python1.67.0, libboost-regex1.67.0 (>= 1.67.0-10), libc6 (>= 2.23), libcairo2 (>= 1.2.4), libcairomm-1.0-1v5 (>= 1.12.0), libexpat1 (>= 2.0.1), libgcc1 (>= 1:3.4), libgmp10, libgomp1 (>= 4.9), libpython3.7 (>= 3.7.0), libsigc++-2.0-0v5 (>= 2.2.0), libstdc++6 (>= 5.2), python3-scipy
Recommends: libgv-python, python-matplotlib, python-cairo, python-gi-cairo, python-gi, gir1.2-gtk-3.0
Homepage: http://graph-tool.skewed.de
Download-Size: 40.1 MB
APT-Manual-Installed: yes
APT-Sources: https://downloads.skewed.de/apt buster/main amd64 Packages
Description: graph-tool is an efficient python module for manipulation and statistical analysis of graphs

Please follow the general troubleshooting steps first:

  • Are you running the latest graph-tool version?
  • Do you observe the problem with the current git version?
  • Are you using Macports or Homebrew? If yes, please submit an issue there instead: https://github.com/Homebrew/brew/issues and https://trac.macports.org/newticket
  • Did you compile graph-tool manually?
  • If you answered yes above, did you use the exact same compiler to build graph-tool, boost-python and Python?
Assignee
Assign to
Time tracking