Raise TypeError: 'NoneType' object is not callable when call render_to_png
- Dominant language
- Python
- Stars
- 2.8k
- Forks
- 419
- PR merge metrics
- No merged PRs in 30d
Description
```
chart.render_to_png(filename=to_fn)
File "/usr/local/lib/python3.8/site-packages/pygal/graph/public.py", line 118, in render_to_png
import cairosvg
File "/usr/local/lib/python3.8/site-packages/cairosvg/__init__.py", line 42, in
from . import surface # noqa isort:skip
File "/usr/local/lib/python3.8/site-packages/cairosvg/surface.py", line 25, in
import cairocffi as cairo
File "/usr/local/lib/python3.8/site-packages/cairocffi/__init__.py", line 48, in
cairo = dlopen(
File "/usr/local/lib/python3.8/site-packages/cairocffi/__init__.py", line 30, in dlopen
library_filename = find_library(library_name)
File "/usr/local/lib/python3.8/ctypes/util.py", line 311, in find_library
return _findSoname_ldconfig(name) or \
File "/usr/local/lib/python3.8/ctypes/util.py", line 276, in _findSoname_ldconfig
with subprocess.Popen(['/sbin/ldconfig', '-p'],
TypeError: 'NoneType' object is not callable
```
Contributor guide
Research direction
Start by reproducing chart.render_to_png(filename=to_fn) and inspect pygal/graph/public.py at render_to_png, then follow the traceback through cairosvg, cairocffi, and ctypes.util.find_library. Done means the reported environment no longer raises the NoneType callable error when rendering a chart to PNG.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data-visualization
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100