Steps to replicate the issue (include links if applicable):
- I have the code correct, and it does log into simple wiki
- When it is run it comes back with a fatal exception
- "CRITICAL: Exiting due to uncaught exception TypeError: 'NoneType' object is not iterable"
- I am running it against https://simple.wikipedia.org/wiki/User:PotsdamLamb/test
- I have references on the page, so the script should be adding the == References == header
toolforge jobs run --image tool-pywikibot/pywikibot-scripts-stable:latest --command "pwb -family:wikipedia -lang:simple noreferences -page:User:PotsdamLamb/test" fix-34434
What happens?:
2024-04-08T18:26:41+00:00 [fix-34434-rkprm] family and mylang are not set. 2024-04-08T18:26:41+00:00 [fix-34434-rkprm] Defaulting to family='wikipedia' and mylang='test'. 2024-04-08T18:26:43+00:00 [fix-34434-rkprm] Retrieving 1 pages from wikipedia:simple. 2024-04-08T18:26:44+00:00 [fix-34434-rkprm] Working on 'User:PotsdamLamb/test' 2024-04-08T18:26:44+00:00 [fix-34434-rkprm] Found ref without references. 2024-04-08T18:26:44+00:00 [fix-34434-rkprm] 2024-04-08T18:26:44+00:00 [fix-34434-rkprm] 1 read operation 2024-04-08T18:26:44+00:00 [fix-34434-rkprm] Execution time: 2024-04-08T18:26:44+00:00 [fix-34434-rkprm] Read operation time: 0.0 seconds 2024-04-08T18:26:44+00:00 [fix-34434-rkprm] Script terminated by exception: 2024-04-08T18:26:44+00:00 [fix-34434-rkprm] 2024-04-08T18:26:44+00:00 [fix-34434-rkprm] ERROR: 'NoneType' object is not iterable (TypeError) 2024-04-08T18:26:44+00:00 [fix-34434-rkprm] Traceback (most recent call last): 2024-04-08T18:26:44+00:00 [fix-34434-rkprm] File "/workspace/pwb.py", line 40, in <module> 2024-04-08T18:26:44+00:00 [fix-34434-rkprm] sys.exit(main()) 2024-04-08T18:26:44+00:00 [fix-34434-rkprm] File "/workspace/pwb.py", line 36, in main 2024-04-08T18:26:44+00:00 [fix-34434-rkprm] runpy.run_path(str(path), run_name='__main__') 2024-04-08T18:26:44+00:00 [fix-34434-rkprm] File "/layers/heroku_python/python/lib/python3.9/runpy.py", line 288, in run_path 2024-04-08T18:26:44+00:00 [fix-34434-rkprm] return _run_module_code(code, init_globals, run_name, 2024-04-08T18:26:44+00:00 [fix-34434-rkprm] File "/layers/heroku_python/python/lib/python3.9/runpy.py", line 97, in _run_module_code 2024-04-08T18:26:44+00:00 [fix-34434-rkprm] _run_code(code, mod_globals, init_globals, 2024-04-08T18:26:44+00:00 [fix-34434-rkprm] File "/layers/heroku_python/python/lib/python3.9/runpy.py", line 87, in _run_code 2024-04-08T18:26:44+00:00 [fix-34434-rkprm] exec(code, run_globals) 2024-04-08T18:26:44+00:00 [fix-34434-rkprm] File "/workspace/pywikibot/scripts/wrapper.py", line 519, in <module> 2024-04-08T18:26:44+00:00 [fix-34434-rkprm] main() 2024-04-08T18:26:44+00:00 [fix-34434-rkprm] File "/workspace/pywikibot/scripts/wrapper.py", line 503, in main 2024-04-08T18:26:44+00:00 [fix-34434-rkprm] if not execute(): 2024-04-08T18:26:44+00:00 [fix-34434-rkprm] File "/workspace/pywikibot/scripts/wrapper.py", line 490, in execute 2024-04-08T18:26:44+00:00 [fix-34434-rkprm] run_python_file(filename, script_args, module) 2024-04-08T18:26:44+00:00 [fix-34434-rkprm] File "/workspace/pywikibot/scripts/wrapper.py", line 147, in run_python_file 2024-04-08T18:26:44+00:00 [fix-34434-rkprm] exec(compile(source, filename, 'exec', dont_inherit=True), 2024-04-08T18:26:44+00:00 [fix-34434-rkprm] File "/workspace/scripts/noreferences.py", line 790, in <module> 2024-04-08T18:26:44+00:00 [fix-34434-rkprm] main() 2024-04-08T18:26:44+00:00 [fix-34434-rkprm] File "/workspace/scripts/noreferences.py", line 784, in main 2024-04-08T18:26:44+00:00 [fix-34434-rkprm] bot.run() 2024-04-08T18:26:44+00:00 [fix-34434-rkprm] File "/workspace/pywikibot/bot.py", line 1468, in run 2024-04-08T18:26:44+00:00 [fix-34434-rkprm] self.treat(page) 2024-04-08T18:26:44+00:00 [fix-34434-rkprm] File "/workspace/pywikibot/bot.py", line 1721, in treat 2024-04-08T18:26:44+00:00 [fix-34434-rkprm] self.treat_page() 2024-04-08T18:26:44+00:00 [fix-34434-rkprm] File "/workspace/scripts/noreferences.py", line 745, in treat_page 2024-04-08T18:26:44+00:00 [fix-34434-rkprm] self.put_current(self.addReferences(text)) 2024-04-08T18:26:44+00:00 [fix-34434-rkprm] File "/workspace/scripts/noreferences.py", line 614, in addReferences 2024-04-08T18:26:44+00:00 [fix-34434-rkprm] for section in i18n.translate(self.site, referencesSections): 2024-04-08T18:26:44+00:00 [fix-34434-rkprm] TypeError: 'NoneType' object is not iterable 2024-04-08T18:26:44+00:00 [fix-34434-rkprm] CRITICAL: Exiting due to uncaught exception TypeError: 'NoneType' object is not iterable
What should have happened instead?:
- it should place the header of == References ==