Enag2000 created this task.
Enag2000 added a project: Pywikibot.
Restricted Application added subscribers: pywikibot-bugs-list, Aklapper.
TASK DESCRIPTION
**Steps to replicate the issue**:
1. Run the example `pwb.py -v category_graph -from` as provided by the
category_graph.py docstring.
**What happens?**:
1. 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 7bb835150a807463a0db018d3c023a735ce15df1
<https://phabricator.wikimedia.org/rPWBC7bb835150a807463a0db018d3c023a735ce15df1>
**Notes:**
The DOT-string is missing exterior curly braces. See pydot
<https://pypi.org/project/pydot/> Input -> 2.
**Proposed Solution:**
Wrap the DOT-string in category_graph.py in curly braces.
TASK DETAIL
https://phabricator.wikimedia.org/T346007
WORKBOARD
https://phabricator.wikimedia.org/project/board/87/
EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: Enag2000
Cc: Aklapper, pywikibot-bugs-list, Enag2000, PotsdamLamb, Jyoo1011,
JohnsonLee01, SHEKH, Dijkstra, Khutuck, Zkhalido, Viztor, Wenyi, Tbscho, MayS,
Mdupont, JJMC89, Dvorapa, Altostratus, Avicennasis, mys_721tx, Xqt, jayvdb,
Masti, Alchimista
_______________________________________________
pywikibot-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]