Steps to replicate the issue:
- Run the example pwb.py -v category_graph -from as provided by the category_graph.py docstring.
What happens?:
- Notice that a TypeError exception occurs with message NoneType is not subscriptable" on line 93.
Full Traceback:
Exception has occurred: TypeError 'NoneType' object is not subscriptable File "C:\git\core\scripts\category_graph.py", line 93, in __init__ self.dot = pydot.graph_from_dot_data(f'digraph {style}')[0] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^ File "C:\git\core\scripts\category_graph.py", line 208, in <module> bot = CategoryGraphBot(ap, args) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\git\core\pywikibot\scripts\wrapper.py", line 147, in run_python_file exec(compile(source, filename, 'exec', dont_inherit=True), File "C:\git\core\pywikibot\scripts\wrapper.py", line 484, in execute run_python_file(filename, script_args, module) File "C:\git\core\pywikibot\scripts\wrapper.py", line 497, in main if not execute(): ^^^^^^^^^ File "C:\git\core\pywikibot\scripts\wrapper.py", line 513, in <module> main() File "C:\git\core\pwb.py", line 35, in main runpy.run_path(str(path), run_name='__main__') File "C:\git\core\pwb.py", line 39, in <module> sys.exit(main()) ^^^^^^ TypeError: 'NoneType' object is not subscriptable
What should have happened instead?:
- pwb.py -v category_graph -from should run without an exception.
Software version:
- pywikibot core master, commit ae36e848115e6beac1df2a0b72ee149e5adc86b4
Notes:
The DOT-string is missing exterior curly braces. See pydot Input -> 2.
Proposed Solution:
Wrap the DOT-string in category_graph.py in curly braces.