Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kernel killed after calling graphviz_layout 512 times #482

Open
tsmith-228 opened this issue Oct 19, 2023 · 1 comment
Open

Kernel killed after calling graphviz_layout 512 times #482

tsmith-228 opened this issue Oct 19, 2023 · 1 comment

Comments

@tsmith-228
Copy link

tsmith-228 commented Oct 19, 2023

I think this may be related to #213?

Running the following code causes windows to kill the python kernel. The workaround from the issue above works but there seems to be an underlying problem (I think in _run_prog in agraph.py?)

import networkx as nx

for _ in range(512):
    G = nx.DiGraph()
    pos = nx.nx_agraph.graphviz_layout(G)

Workaround

# pywin32 package
import win32file as wfile

# Set to something above wfile._getmaxstdio(), according to your needs
wfile._setmaxstdio(513)

Windows 10
Python 3.11.5
networkx 3.1
pygraphviz 1.11

@DanielGiel
Copy link

Hey there,

I got the same Issue on Windows 11, with Python 3.9.13.
I guess the file handles are not getting closed, since there are always exactly 510 calls that finish sucessfully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants