Manual talk:Pywikibot

Jump to: navigation, search

About this board


Please use one of the communication channels listed on Manual:Pywikibot/Communication rather than using this discussion board. There is very little traffic here, so it may take a while before you get a response.

Why Pywikibot marks my edits as minor edits?

Fructibus (talkcontribs)

I am running Pywikibot/ at this moment, adding a category to a list of files.

I just noticed that the edits of my bot ( commons:Special:Contributions/Fructibot ) are marked as minor edits. Why is that and how can I fix it?

Xqt (talkcontribs)

The reason is that bot edits normally should not be shown on user's watch list. This is done by this flag. The minor flag could be set on pywikibot.put() with minorEdit=False parameter or on method with minor=False parameter. But use it with care not to disturb other users flooding their watch lists.

Fructibus (talkcontribs)

Ahh, I see now, I was worried that maybe the robot is supposed to make normal edits, not minor edits, and therefore maybe I did something wrong. Thank you very much! (talkcontribs)


I need a script that:

1) Select pages that are in a specific category

2) Delete in those pages an old template with its parameters (that could also be sub-templates); the template is the same, but the content is different for all, so I can't specify manually the text

3) And replace it with a text (a new template with standard content for all)

It's possible? I see something in '''' (point 1 and 3), but I'm not sure it can do the 2nd; and it seems that '''' can only replace the template name.


Xqt (talkcontribs)

Try script.

Glz19 (talkcontribs)

Thank you for the answer. It's possible with it selecting a category, for work only on pages in it? I read the documentation page but I can't see it.

Xqt (talkcontribs)

All scripts have a documentation with it. Just use -help option. In your case -cat:<categoryname> should do it.

Reply to "Replacing template with text"
Walter Klosse (talkcontribs)

How i make pagegenerator for category on wikipedia in czech language?

Framawiki (talkcontribs)

Hello, do you want something like

python replace "1" "2" -lang:cz -category:test


Dvorapa (talkcontribs)

correct is -lang:cs

Reply to "Pagegenerator in different language."
KlosseBot (talkcontribs)

CMD writing no module named pywikibot when i start

Xqt (talkcontribs)

Looks like your cmd has opened the "../core/scripts" path. You should start from parent "core" path and use the wrapper script: login

2A00:1028:9192:FA72:F903:A911:3814:C073 (talkcontribs)

And when i write python login it said no module named request.

Xqt (talkcontribs)

You have to install request module as a side package first. Read the message and do as proposed. The message is:

Python module 'requests' is required.

Try running 'pip install requests'

do it with the command

pip install requests (talkcontribs)

I executed "pip install requests", it did so, but the same error doesn't go away. I tried both Python 3.6 and 2.7, it's the same with both.

Framawiki (talkcontribs)

Hello, can you type python version and post here what you obtain ? (talkcontribs)

This doesn't even work for me, as it gets an error in line 163 of

Xqt (talkcontribs)

Did you installed requests for both python releases? (talkcontribs)

I installed 2.7 after trying 3.6. I eventually got things to work after installing pip seperately again and then installing requests via "pip install requests" and restarting. I may have repeated this some times and can't pinpoint what got things to work, but i eventually got it to work.

KlosseBot (talkcontribs)

'pip install requests' doesnt work

Xqt (talkcontribs)

What is your python version? I propose using 2.7.9 or higher or 3.4 or higher release because the en:python package installer (pip) is shipped with these versions. Otherwise you have to install pip first.

KlosseBot (talkcontribs)

I have 3.4 but still it isnt pip in it. How do i install it?

Xqt (talkcontribs)

Maybe this could help.

This comment was hidden by Walter Klosse (history)
Xqt (talkcontribs)

You are redefine your default mylang and family which is wikipedia:cs then.

KlosseBot (talkcontribs)

How? Now i have just wikidata and still same response.

Reply to "wikidata is not valid site"

Uploading files with titles containing UTF-8 characters

Jc86035 (talkcontribs)

I was having trouble uploading python -keep -noverify -ignorewarn "/…/BSicon hÜST.svg" narrow formations. Do I need to escape the Ü?

Xqt (talkcontribs)

No idea. A traceback would help to find out the problem.

Jc86035 (talkcontribs)

(Third comment in thread; had previous revisions suppressed)

ERROR: Traceback (most recent call last):
 File "/…/Documents/pywikibot/pywikibot/data/", line 1558, in submit
   body=body, headers=headers)
 File "/…/Documents/pywikibot/pywikibot/tools/", line 1105, in wrapper
   return obj(*__args, **__kw)
 File "/…/Documents/pywikibot/pywikibot/comms/", line 279, in request
   r = fetch(baseuri, method, body, headers, **kwargs)
 File "/…/Documents/pywikibot/pywikibot/comms/", line 381, in fetch
 File "/…/Documents/pywikibot/pywikibot/comms/", line 297, in error_handling_callback
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 884: ordinal not in range(128)
Xqt (talkcontribs)

Seems the traceback isn't complete. I propose to file a bug at phabricator:

Jc86035 (talkcontribs)

(I've tried changing multiple instances of "ascii" in the config files to "utf-8" but there was no effect.)

Jc86035 (talkcontribs)

I am trying to delay so it makes edits every eight seconds, so the script isn't stopped after every eight page moves by the Commons API. However, the script ignores settings for delay since the action is not an edit but a page move. How can I add a delay?

Xqt (talkcontribs)

Please file a bug at [ phabricator]. Seems this is a real bug and should ne solved

Jc86035 (talkcontribs)

Filed a bug, T173914.

Reply to "Delay in"
SamiIslam (talkcontribs)


Can a normal user use the pywikibot functionality from a wiki site to create a site from a text file? Or is that something only an admin would have to do on the server hosting the wiki?



Xqt (talkcontribs)

There is a script "" to do this but it is may be local community restrictions to allow or discard edits in this way.

Reply to "Pywikibot usage"
Jc86035 (talkcontribs)

Does update redirects as well to avoid creating double redirects?

This comment was hidden by Jc86035 (history)
Xqt (talkcontribs)

Currently not.

Jc86035 (talkcontribs)

Are there any scripts which do so?

XXN (talkcontribs)

Reply to "Moving pages"

how can i get transclusions template

جار الله (talkcontribs)

Hello how can i get transclusions template using Pywikibot core?