Page MenuHomePhabricator

Anchor templates should be recognizes in cases SectionError is raises
Closed, DuplicatePublic

Description

For example
py -3.13 -m pwb -user:xqbot redirect br -lang:pl
raises a SectionError: 'BEZŁAD' is not a valid section of Wikipedia:Czym Wikipedia nie jest but anchors were given:
{{anchor|BEZŁAD}}{{anchor|Bezład}}{{anchor|NIEŁAD}}{{anchor|Nieład}}

>>> Wikipedia:BEZŁAD <<<

14 read operations
1 write operation
Execution time: 1 minutes, 7 seconds
Read operation time: 4.8 seconds
Write operation time: 67.0 seconds
Script terminated by exception:

ERROR: 'BEZŁAD' is not a valid section of Wikipedia:Czym Wikipedia nie jest (SectionError)
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:\pwb\GIT\core\pwb.py", line 40, in <module>
    sys.exit(main())
             ~~~~^^
  File "C:\pwb\GIT\core\pwb.py", line 36, in main
    runpy.run_path(str(path), run_name='__main__')
    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen runpy>", line 287, in run_path
  File "<frozen runpy>", line 98, in _run_module_code
  File "<frozen runpy>", line 88, in _run_code
  File "C:\pwb\GIT\core\pywikibot\scripts\wrapper.py", line 554, in <module>
    main()
    ~~~~^^
  File "C:\pwb\GIT\core\pywikibot\scripts\wrapper.py", line 538, in main
    if not execute():
           ~~~~~~~^^
  File "C:\pwb\GIT\core\pywikibot\scripts\wrapper.py", line 525, in execute
    run_python_file(filename, script_args, module)
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\pwb\GIT\core\pywikibot\scripts\wrapper.py", line 154, in run_python_file
    exec(compile(source, filename, 'exec', dont_inherit=True),
    ~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
         main_mod.__dict__)
         ^^^^^^^^^^^^^^^^^^
  File "C:\pwb\GIT\core\scripts\redirect.py", line 769, in <module>
    main()
    ~~~~^^
  File "C:\pwb\GIT\core\scripts\redirect.py", line 765, in main
    bot.run()
    ~~~~~~~^^
  File "C:\pwb\GIT\core\pywikibot\bot.py", line 1574, in run
    self.treat(page)
    ~~~~~~~~~~^^^^^^
  File "C:\pwb\GIT\core\scripts\redirect.py", line 689, in treat
    super().treat(page)
    ~~~~~~~~~~~~~^^^^^^
  File "C:\pwb\GIT\core\pywikibot\bot.py", line 1821, in treat
    self.treat_page()
    ~~~~~~~~~~~~~~~^^
  File "C:\pwb\GIT\core\scripts\redirect.py", line 507, in delete_1_broken_redirect
    targetPage.get()
    ~~~~~~~~~~~~~~^^
  File "C:\pwb\GIT\core\pywikibot\page\_basepage.py", line 394, in get
    raise SectionError(f'{page_section!r} is not a valid section '
                       f'of {self.title(with_section=False)}')
pywikibot.exceptions.SectionError: 'BEZŁAD' is not a valid section of Wikipedia:Czym Wikipedia nie jest
CRITICAL: Exiting due to uncaught exception SectionError: 'BEZŁAD' is not a valid section of Wikipedia:Czym Wikipedia nie jest