Hi all,

on my first steps with Python and Pywikibot, i encounter the following strange error message:

2024-05-3116:23:19__init__.py, 373in             _flush: VERBOSE  Dropped throttle(s). 2024-05-3116:23:19http.py, 119in              flush: VERBOSE  Closing network session. 2024-05-3116:23:19http.py, 123in              flush: VERBOSE  Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "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 run
    if not execute():
           ^^^^^^^^^
  File "C:\Users\florian\AppData\Roaming\Python\Python312\site-packages\pywikibot\scripts\wrapper.py", line 492, in execute
    run_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_file
    exec(compile(source, filename, 'exec', dont_inherit=True),
  File ".\HandleCommonsOnOSMBot.py", line 192, in <module>
    main()
  File ".\HandleCommonsOnOSMBot.py", line 188, in main
HandleCommonsOnOSMBot(generator=gen_factory.getCombinedGenerator(), **options).run()   File "C:\Users\florian\AppData\Roaming\Python\Python312\site-packages\pywikibot\bot.py", line 1470, in run
self.generator= (item for item in self.generator)
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'NoneType'object is not iterable
2024-05-3116:23:19http.py, 132in              flush: CRITICALExiting due to uncaught exception TypeError: 'NoneType'object is not iterable 2024-05-3116:23:19http.py, 137in              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-le...@lists.wikimedia.org

Reply via email to