From Meta, a Wikimedia project coordination wiki
Jump to navigation Jump to search


Hopefully some people find this script useful. I made it because I needed an easy way to upload lots of images to one of my wikis. -Jonathan Kovaciny 21:53, 8 June 2007 (UTC)

I'm happy to say I've already found this quite useful! :) Blckdmnd99 05:03, 15 June 2007 (UTC)

Bug when uploading files with ' in the file name[edit]

When uploading files with apostrophes in the file name, it cuts off everything before the last apostrophe and uploads under the wrong name. For example, it uploaded a file named Bigleaf_Hydrangea_Hydrangea_macrophylla_'Tokyo_Delight'_Pink_3008px.jpg as "'_Pink_3008px.jpg". —Zachary talk 05:43, 3 February 2008 (UTC)

Error when using this...[edit]

Getting an error when I attempt to run this:

UnicodeDecodeError: 'utf8' codec can't decode bytes in position 0-1: unexpected end of data

The command I'm using is: -file:"Icon List.txt" -nodesc

Anyone know what's up? --DragoonWraith 17:04, 1 November 2008 (UTC)

Further tests have this error popping up no matter what I do - even if I use uploadmultiple -help! DragoonWraith 01:36, 2 November 2008 (UTC)
See below. Adamtheclown 11:12, 19 November 2010 (UTC)

unicode error[edit]

  File "C:\Users\t\Desktop\pywikipedia\", line 78
    'pt': u'Upload τπo automßtica'
SyntaxError: (unicode error) 'utf8' codec can't decode byte 0xe7 in position 0:
unexpected end of data

I fixed the error:

SyntaxError: (unicode error) 'utf8' codec can't decode byte 0xe7 in position 0:

By deleting all of the foreign language lines.

Adamtheclown 11:35, 19 November 2010 (UTC)

ImportError: No module named mediawiki_messages[edit] works for me, this script does not work though.

I was attempting to upload two images and got this error:

unicode test: triggers problem #3081100
Traceback (most recent call last):
  File "C:\Users\t\Desktop\pywikipedia\", line 62, in <module>
    import wikipedia, config, mediawiki_messages
ImportError: No module named mediawiki_messages "Allows access to the MediaWiki messages, that's the label texts of the MediaWiki software in the current language"

Deleting mediawiki_messages reference

I deleted the two references to mediawiki_messages, but I also had to remove a good portion of the error message coding too. The script now runs smoothly:

But nothing actually happens on my wiki. no images are actually uploaded.

This script says :

This script is a combination of and by Andre Engles (2004).

Neither of these scripts ( and have the code mediawiki_messages in them.

Differences between lines:

import wikipedia, config, mediawiki_messages (line 32-33)

import wikipedia as pywikibot
import config, query (line 53-54)

import wikipedia as pywikibot
import config

Adamtheclown 17:30, 20 November 2010 (UTC)

moved error with mediawiki_msg[edit] is in the pywikipedia/archive folder.

I suspect that it was once in the root pywikipedia/ folder, but was then moved. I moved:


to the root folder


Then received this error message:

Adamtheclown 17:45, 20 November 2010 (UTC)

Solution for ImportError: No module named mediawiki_messages[edit]

If you don't want to move around things in the bot installation directory, you can in replace the line

import wikipedia, config, mediawiki_messages


import wikipedia, config
import archive.mediawiki_messages as mediawiki_messages

Then add an empty file called (exactly like this!) to the archive/ directory (e.g. using Unix touch) and the import will be able to find in there.

-- 17:41, 7 February 2011 (UTC)

ASCII error[edit]

          C:\Users\Eigenaar\Documents\Mark\Wikia\Afbeeldingen\TERA Wiki\Screenshots\
    Screenshot_ (1).jpg
    Uploading file to tera:en
    'ascii' codec can't decode byte 0xff in position 546: ordinal not in range(128)
    WARNING: Could not open '
    eskin=monobook'. Maybe the server or
     your connection is down. Retrying in 1 minutes...

I'm getting that error when trying to run this script. I've applied all of the fixes above. Does anybody have any idea how to fix this? 15:39, 19 May 2011 (UTC)

I have the same problem --Ivesklein 01:24, 5 January 2012 (UTC)

Uploading file to FeUAI:es
'utf8' codec can't decode byte 0xff in position 550: invalid start byte
WARNING: Could not open '
cial:Upload&useskin=monobook'. Maybe the server or
 your connection is down. Retrying in 1 minutes...
Short answer: Install Python 2.6.5
Long answer: doesn't work with Python 2.7.2 (ascii codec error), and Python 2.6.6+ and 2.7.0 fail at unicode test: triggers problem #3081100
Well... I didn't test 2.7.1... -- 01:13, 14 February 2012 (UTC)