Meno25 created this task.
Meno25 added projects: Pywikibot, Pywikibot-Scripts.
Restricted Application added subscribers: pywikibot-bugs-list, alaa, Aklapper.

TASK DESCRIPTION
  **Background information**
  
  - The Moroccan Arabic Wikipedia (arywiki) has some pages with invalid titles.
  - Examples of such pages (they give invalid title error when trying to access 
them):
    - ary:مداكرة:قيسارية:طب 
<https://ary.wikipedia.org/wiki/%D9%85%D8%AF%D8%A7%D9%83%D8%B1%D8%A9:%D9%82%D9%8A%D8%B3%D8%A7%D8%B1%D9%8A%D8%A9:%D8%B7%D8%A8>
    - ary:مداكرة:قيسارية:فلسفة 
<https://ary.wikipedia.org/wiki/%D9%85%D8%AF%D8%A7%D9%83%D8%B1%D8%A9:%D9%82%D9%8A%D8%B3%D8%A7%D8%B1%D9%8A%D8%A9:%D9%81%D9%84%D8%B3%D9%81%D8%A9>
    - ary:مداكرة:قيسارية:لماط 
<https://ary.wikipedia.org/wiki/%D9%85%D8%AF%D8%A7%D9%83%D8%B1%D8%A9:%D9%82%D9%8A%D8%B3%D8%A7%D8%B1%D9%8A%D8%A9:%D9%84%D9%85%D8%A7%D8%B7>
  - Translation:
    - `مداكرة` --> `Talk`
    - `قيسارية` --> `Portal`
  
  So, the link title can be translated as:
  
  - `مداكرة:قيسارية:طب` --> `Talk:Portal:طب`
  
  **Steps to replicate the issue**
  
    python pwb.py cosmetic_changes -start:Talk:! -lang:ary
  
  **Output**:
  
    Script terminated by exception:
    
    ERROR: The (non-)talk page of 'مداكرة:قيسارية:طب' is a valid title in 
another namespace. (InvalidTitleError)
    Traceback (most recent call last):
      File "C:\Users\Mohammed\Downloads\core\pwb.py", line 39, in <module>
        sys.exit(main())
                 ^^^^^^
      File "C:\Users\Mohammed\Downloads\core\pwb.py", line 35, in main
        runpy.run_path(str(path), run_name='__main__')
      File "<frozen runpy>", line 291, in run_path
      File "<frozen runpy>", line 98, in _run_module_code
      File "<frozen runpy>", line 88, in _run_code
      File "C:\Users\Mohammed\Downloads\core\pywikibot\scripts\wrapper.py", 
line 516, in <module>
        main()
      File "C:\Users\Mohammed\Downloads\core\pywikibot\scripts\wrapper.py", 
line 500, in main
        if not execute():
               ^^^^^^^^^
      File "C:\Users\Mohammed\Downloads\core\pywikibot\scripts\wrapper.py", 
line 487, in execute
        run_python_file(filename, script_args, module)
      File "C:\Users\Mohammed\Downloads\core\pywikibot\scripts\wrapper.py", 
line 147, in run_python_file
        exec(compile(source, filename, 'exec', dont_inherit=True),
      File "C:\Users\Mohammed\Downloads\core\scripts\cosmetic_changes.py", line 
131, in <module>
        main()
      File "C:\Users\Mohammed\Downloads\core\scripts\cosmetic_changes.py", line 
127, in main
        bot.run()
      File "C:\Users\Mohammed\Downloads\core\pywikibot\bot.py", line 1692, in 
run
        for item in self.generator:
      File 
"C:\Users\Mohammed\Downloads\core\pywikibot\pagegenerators\__init__.py", line 
629, in PreloadingGenerator
        site = page.site
               ^^^^^^^^^
      File "C:\Users\Mohammed\Downloads\core\pywikibot\page\_basepage.py", line 
141, in site
        return self._link.site
               ^^^^^^^^^^^^^^^
      File "C:\Users\Mohammed\Downloads\core\pywikibot\page\_links.py", line 
506, in site
        self.parse()
      File "C:\Users\Mohammed\Downloads\core\pywikibot\page\_links.py", line 
450, in parse
        raise InvalidTitleError(
    pywikibot.exceptions.InvalidTitleError: The (non-)talk page of 
'مداكرة:قيسارية:طب' is a valid title in another namespace.
    CRITICAL: Exiting due to uncaught exception InvalidTitleError: The 
(non-)talk page of 'مداكرة:قيسارية:طب' is a valid title in another namespace.
  
  **What happens?**:
  
  - The bot crashes and the bot run has to be restarted again.
  
  **What should have happened instead?**:
  
  - The bot should have skipped such pages and continued running on the rest of 
the namespace.
  
  **Software version**
  
    Pywikibot: [https] r-pywikibot-core (7300801, g17709, 2023/04/13, 16:11:44, 
master)
    Release version: 8.1.0.dev4
    setuptools version: 67.6.1
    mwparserfromhell version: 0.6.4
    wikitextparser version: n/a
    requests version: 2.28.2
        certificate test: ok
    Python: 3.11.3 (tags/v3.11.3:f3909b8, Apr  4 2023, 23:49:59) [MSC v.1934 64 
bit (AMD64)]

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

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

To: Meno25
Cc: Aklapper, alaa, Meno25, pywikibot-bugs-list, PotsdamLamb, Jyoo1011, 
JohnsonLee01, SHEKH, Dijkstra, Khutuck, Zkhalido, Viztor, Wenyi, Tbscho, MayS, 
Framawiki, Mdupont, JJMC89, Dvorapa, Altostratus, Avicennasis, mys_721tx, Xqt, 
jayvdb, Masti, Alchimista
_______________________________________________
pywikibot-bugs mailing list -- pywikibot-bugs@lists.wikimedia.org
To unsubscribe send an email to pywikibot-bugs-le...@lists.wikimedia.org

Reply via email to