Talk:Uploadmultiple.py

Latest comment: 12 years ago by 79.147.182.17 in topic ASCII error

hopefully edit

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)Reply

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

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)Reply

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:

uploadmultiple.py -file:"Icon List.txt" -nodesc

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

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)Reply
See below. Adamtheclown 11:12, 19 November 2010 (UTC)Reply

unicode error edit

C:\Users\t\Desktop\pywikipedia>Uploadmultiple.py
  File "C:\Users\t\Desktop\pywikipedia\Uploadmultiple.py", 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)Reply


ImportError: No module named mediawiki_messages edit

Upload.py works for me, this script does not work though.

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

C:\Users\t\Desktop\pywikipedia>Uploadmultiple.py
unicode test: triggers problem #3081100
Traceback (most recent call last):
  File "C:\Users\t\Desktop\pywikipedia\Uploadmultiple.py", line 62, in <module>
    import wikipedia, config, mediawiki_messages
ImportError: No module named mediawiki_messages


pywikipedia.py/mediawiki_messages.py "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 Uploadmultiple.py script says :

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

Neither of these scripts (pagefromfile.py and upload.py) have the code mediawiki_messages in them.

Differences between lines:

Uploadmultiple:
import wikipedia, config, mediawiki_messages

Upload.py: (line 32-33)

import wikipedia as pywikibot
import config, query

Pagefromfile.py: (line 53-54)

import wikipedia as pywikibot
import config

Adamtheclown 17:30, 20 November 2010 (UTC)Reply

moved mediawiki_messages.py error with mediawiki_msg edit

mediawiki_messages.py is in the pywikipedia/archive folder.

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

pywikipedia/archive/mediawiki_messages.py

to the root folder

/pywikipedia.

Then received this error message:

Adamtheclown 17:45, 20 November 2010 (UTC)Reply

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 Uploadmultiple.py replace the line

import wikipedia, config, mediawiki_messages

with

import wikipedia, config
import archive.mediawiki_messages as mediawiki_messages

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

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

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 'http://tera.wikia.com/index.php?title=Special:Upload&us
    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? 213.93.184.183 15:39, 19 May 2011 (UTC)Reply


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

C:\scripts\img\adrian-solar-lozier.jpg
       
       
Uploading file to FeUAI:es
'utf8' codec can't decode byte 0xff in position 550: invalid start byte
WARNING: Could not open 'http://www.boxmedia.cl/~feuai/wiki/index.php?title=Espe
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: upload.py 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... --79.147.182.17 01:13, 14 February 2012 (UTC)Reply
Return to "Uploadmultiple.py" page.