Xqt created this task.
Xqt added projects: Pywikibot, Pywikibot-tests.
Restricted Application added subscribers: pywikibot-bugs-list, Aklapper.

TASK DESCRIPTION
  The test for `kb.mozillazine.org` fails with ClientError (404)  because the 
site now enforces a JavaScript- and cookie-based challenge (Anubis bot 
protection) before granting access to any content. Pywikibot uses plain HTTP 
requests without executing JavaScript, so it cannot solve the challenge and 
therefore receives a 404/redirect response instead of the expected MediaWiki 
API output. This is not an issue in Pywikibot itself but a change in the target 
site, so the test should be skipped or the URL removed.
  
    C:\pwb\GIT\core>py -3.13 -m pwb site_detect_tests -v 
MediaWikiSiteTestCase.test_standard_version_sites
    tests: max_retries reduced from 15 to 3
    test_standard_version_sites 
(__main__.MediaWikiSiteTestCase.test_standard_version_sites)
    Test detection of standard MediaWiki sites. ...
      test_standard_version_sites 
(__main__.MediaWikiSiteTestCase.test_standard_version_sites) 
(url='kb.mozillazine.org')
    Test detection of standard MediaWiki sites. ... ERROR
     12.672s
    ======================================================================
    ERROR: test_standard_version_sites 
(__main__.MediaWikiSiteTestCase.test_standard_version_sites) 
(url='kb.mozillazine.org')
    Test detection of standard MediaWiki sites.
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "C:\pwb\GIT\core\tests\site_detect_tests.py", line 110, in 
test_standard_version_sites
        self.assertSite(url)
        ~~~~~~~~~~~~~~~^^^^^
      File "C:\pwb\GIT\core\tests\site_detect_tests.py", line 38, in assertSite
        self.assertIsInstance(MWSite(url), MWSite)
                              ~~~~~~^^^^^
      File "C:\pwb\GIT\core\pywikibot\site_detect.py", line 48, in __init__
        check_response(r)
        ~~~~~~~~~~~~~~^^^
      File "C:\pwb\GIT\core\pywikibot\site_detect.py", line 301, in 
check_response
        raise err_class(msg)
    pywikibot.exceptions.ClientError: (404) Nothing matches the given URI
    
    ----------------------------------------------------------------------
    Ran 1 test in 12.673s
    
    FAILED (errors=1)

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

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