gives just None for the generator attribute.HandleCommonsOnOSMBot(generator=gen_factory.getCombinedGenerator(), **options)
Am 31.05.2024 um 16:36 schrieb tohuuu <th@tohuuu.de>:
Hi all,
on my first steps with Python and Pywikibot, i encounter the following strange error message:
2024-05-31 16:23:19 __init__.py, 373 in _flush: VERBOSE Dropped throttle(s).2024-05-31 16:23:19 http.py, 119 in flush: VERBOSE Closing network session.2024-05-31 16:23:19 http.py, 123 in flush: VERBOSE Traceback (most recent call last):File "<frozen runpy>", line 198, in _run_module_as_mainFile "<frozen runpy>", line 88, in _run_codeFile "C:\Users\florian\AppData\Roaming\Python\Python312\Scripts\pwb.exe\__main__.py", line 7, in <module>sys.exit(run())^^^^^File "C:\Users\florian\AppData\Roaming\Python\Python312\site-packages\pywikibot\scripts\wrapper.py", line 516, in runif not execute():^^^^^^^^^File "C:\Users\florian\AppData\Roaming\Python\Python312\site-packages\pywikibot\scripts\wrapper.py", line 492, in executerun_python_file(filename, script_args, module)File "C:\Users\florian\AppData\Roaming\Python\Python312\site-packages\pywikibot\scripts\wrapper.py", line 149, in run_python_fileexec(compile(source, filename, 'exec', dont_inherit=True),File ".\HandleCommonsOnOSMBot.py", line 192, in <module>main()File ".\HandleCommonsOnOSMBot.py", line 188, in mainHandleCommonsOnOSMBot(generator=gen_factory.getCombinedGenerator(), **options).run()File "C:\Users\florian\AppData\Roaming\Python\Python312\site-packages\pywikibot\bot.py", line 1470, in runself.generator = (item for item in self.generator)^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^TypeError: 'NoneType' object is not iterable2024-05-31 16:23:19 http.py, 132 in flush: CRITICAL Exiting due to uncaught exception TypeError: 'NoneType' object is not iterable2024-05-31 16:23:19 http.py, 137 in flush: VERBOSE Network session closed.
This error encounters when my script is finished and pywikibot closing the network session. For the complete source code, please see
https://github.com/tohuuuuu/HandleCommonsOnOSMBot/blob/main/HandleCommonsOnOSMBot.py
I took the part starting with "def main(*args: str) -> None:" from https://doc.wikimedia.org/pywikibot/stable/library_usage.html - maybe this isn't the correct way to use it? Since the bot code works fine, it looks like a minor problem, but i'm curious if i did something wrong.
Cheers
Florian
_______________________________________________
pywikibot mailing list -- pywikibot@lists.wikimedia.org
Public archives at https://lists.wikimedia.org/hyperkitty/list/pywikibot@lists.wikimedia.org/message/BDVKXYTCXTF7CRMD3KTENHEIE2NPQN35/
To unsubscribe send an email to pywikibot-leave@lists.wikimedia.org