On Fri, Jul 18, 2014 at 1:40 PM, Amir Ladsgroup <[email protected]> wrote:
> I made a patch to add any customized user agent and (username would be
> default) and if the person doesn't want to add any user agent, they just can
> set it to " "
>
> https://gerrit.wikimedia.org/r/#/c/147381/

This was merged a week ago.

There is now a config variable to specify the user-agent.

https://gerrit.wikimedia.org/r/#/c/147381/15/pywikibot/config2.py,cm

Amir helpfully put together some documentation here:

https://www.mediawiki.org/wiki/Manual:Pywikibot/User-agent

By default it includes the bot username in the user-agent *only* when
it is connecting to a 'Site' listed in your user-config.py .  This is
still not what the WMF user agent policy requires, as pywikibot
frequently reads data from Sites while logged out, or logged in
without an entry in the user-config.py.  This was specifically
mentioned in the wikitech-l discussion as one of the reasons to put a
username in the user-agent ; when reading while logged out, the
username is not in the payload.

There is also the chance that pywikibot might write while logged out.
Pywikibot page & site modules typically have checks to prevent that
from occurring, but they are not mandatory, and bugs may slip into the
core framework, and script writers might bypass the page & site
modules.  We have a changeset pending approval to enforce being logged
in at the API layer.

https://gerrit.wikimedia.org/r/#/c/147837/

There is an old enhancement request i found for adding file hashes to
the useragent, so I have put some thoughts there.

https://bugzilla.wikimedia.org/show_bug.cgi?id=55016

-- 
John Vandenberg

_______________________________________________
Pywikipedia-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l

Reply via email to