JJMC89 created this task.
JJMC89 added a project: Pywikibot.
Restricted Application added subscribers: pywikibot-bugs-list, Aklapper.

TASK DESCRIPTION
  **Steps to replicate the issue** (include links if applicable):
  
  name=python3 pwb.py shell
    >>> site = pywikibot.Site()
    >>> page = pywikibot.Page(site, 'Wikipedia:Categories for 
discussion/Log/2025 November 8#Japanese superhero films by decade')
    >>> page.text
  
  **What happens?**:
  
    Traceback (most recent call last):
      File "<console>", line 1, in <module>
      File "/home/jjmc89/wrk/pwb/pywikibot/page/_basepage.py", line 581, in text
        return self.get(get_redirect=True)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/jjmc89/wrk/pwb/pywikibot/page/_basepage.py", line 396, in get
        raise SectionError(f'{page_section!r} is not a valid section '
    pywikibot.exceptions.SectionError: 'Japanese superhero films by decade' is 
not a valid section of Wikipedia:Categories for discussion/Log/2025 November 8
  
  **What should have happened instead?**:
  
  An exception is not raised due to a LRM being present in the wikitext but not 
in `page.section()`.
  
  `[[Wikipedia:Categories for discussion/Log/2025 November 8#Japanese superhero 
films by decade]]` is a working link to the section of the page with `==== 
Japanese superhero films\u200e by decade ====`.
  
  **Software version** (on `Special:Version` page; skip for WMF-hosted wikis 
like Wikipedia): 
  Pywikibot: [ssh] pywikibot-core (af27117 
<https://phabricator.wikimedia.org/rPWBCaf271172a09b39f9f68d707520dad454cefd74db>,
 g20065, 2025/11/28, 21:37:46, master)
  Release version: 11.0.0.dev2
  
  **Other information** (browser name/version, screenshots, etc.):
  
  Report based on the content of the page as of 
https://en.wikipedia.org/w/index.php?title=Wikipedia:Categories_for_discussion/Log/2025_November_8&oldid=1324681231,
 which was subsequently edited to remove the LRM.

TASK DETAIL
  https://phabricator.wikimedia.org/T411307

WORKBOARD
  https://phabricator.wikimedia.org/project/board/87/

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

_______________________________________________
pywikibot-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to