Page MenuHomePhabricator

Update config.user_agent_format to be compliant with WM Foundation UA Policy
Closed, ResolvedPublicFeature

Description

Update config.user_agent_format to be compliant with WM Foundation UA Policy. This requires to provide either an email or a specific url for the bot.

See also:

Event Timeline

Xqt changed the subtype of this task from "Task" to "Feature Request".Jan 10 2026, 9:25 AM

I asked AI and changed pywikipot/comms/http.py :

replace

if site:
    script_comments.append(str(site))

with

if site:
    script_comments.append(
        f'{site.protocol()}://{site.hostname()}'
    )

and no more problem with 429 status

I asked AI and changed pywikipot/comms/http.py :

Hi @JAnD, thank you for this proposal. I think it will be implemented in such a way, but I still get this 429 issue even with a fixed UA, fixed URL, and email, and even after adding a mindelay. The old Pywikibot UA should match for the most wikis after this string. Obviously there is a newly introduced limit for API access except bots running on Toolforge even the bot is registered and has a bot flag.

It’s extremely frustrating and time-consuming to constantly chase all those upstream changes at the moment and at a time I was going to publish Pywikibot 11.

The user name is always required in UA as User:<username> but sometimes it is missing. This can happen if there is no username given within user-config.py, maybe also for wildcard usage. For Pywikibot tests the environment variable can be used.

Change #1226297 had a related patch set uploaded (by Xqt; author: Xqt):

[pywikibot/core@master] IMPR: Use environment variables is usernames aren't within config.py

https://gerrit.wikimedia.org/r/1226297

Change #1226297 merged by jenkins-bot:

[pywikibot/core@master] IMPR: Use environment variables is usernames aren't within config.py

https://gerrit.wikimedia.org/r/1226297

Change #1235310 had a related patch set uploaded (by Xqt; author: Xqt):

[pywikibot/core@master] UA: Replace "family", "code", and "lang" in user_agent format string

https://gerrit.wikimedia.org/r/1235310

Change #1235310 merged by jenkins-bot:

[pywikibot/core@master] UA: Cleanup UA format string

https://gerrit.wikimedia.org/r/1235310

Change #1237694 had a related patch set uploaded (by Xqt; author: Xqt):

[pywikibot/core@master] UA: use URL to user page in user agent

https://gerrit.wikimedia.org/r/1237694

Change #1237694 merged by jenkins-bot:

[pywikibot/core@master] UA: use URL to user page in user agent

https://gerrit.wikimedia.org/r/1237694